• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python expecter.expect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中expecter.expect函数的典型用法代码示例。如果您正苦于以下问题:Python expect函数的具体用法?Python expect怎么用?Python expect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了expect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_can_be_pickled

 def test_can_be_pickled(self):
     obj = [1, 2, 3]
     delegator = SimpleDelegator(obj)
     pickled = pickle.dumps(delegator)
     del delegator
     unpickled_delegator = pickle.loads(pickled)
     expect(get_delegated(unpickled_delegator)) == obj
开发者ID:sumeet,项目名称:simpledelegator,代码行数:7,代码来源:test.py


示例2: is_returned_when_file_exists

        def is_returned_when_file_exists(template):
            template.root = "my_root"

            with patch('pathlib.Path.is_file', Mock(return_value=True)):
                path = template.path

            expect(path) == Path("my_root/abc/default.png")
开发者ID:DanLindeman,项目名称:memegen,代码行数:7,代码来源:test_domain_template.py


示例3: should_be_sigmoid_of_sum_of_incoming_values

 def should_be_sigmoid_of_sum_of_incoming_values(self):
     incoming = StubSynapse(1.0)
     neuron = Neuron()
     neuron.add_incoming(incoming)
     neuron.add_incoming(incoming)
     neuron.fire()
     expect(neuron.activation) == sigmoid(2.0)
开发者ID:kippr,项目名称:neato,代码行数:7,代码来源:model_tests.py


示例4: test_display_non_verbose

 def test_display_non_verbose(self, stdout):
     locs = NumberedPoints(['Home', '52.168;0.040'],
                           config_locations={'Home': (52.015, -0.221)})
     locs.format = 'locator'
     locs.verbose = False
     locs.display('extsquare')
     expect(stdout.getvalue()) == 'IO92va33\nJO02ae40\n'
开发者ID:encukou,项目名称:upoints,代码行数:7,代码来源:test_edist.py


示例5: it_expects_greater_than_or_equal

 def it_expects_greater_than_or_equal(self):
     expect(1) >= 1
     expect(2) >= 1
     def _fails(): expect(1) >= 2
     assert_raises(AssertionError, _fails)
     assert fail_msg(_fails) == (
         'Expected something greater than or equal to 2 but got 1')
开发者ID:pombredanne,项目名称:expecter,代码行数:7,代码来源:test_expecter.py


示例6: when_off_ci

    def when_off_ci(monkeypatch):
        monkeypatch.delenv('CI', raising=False)
        monkeypatch.delenv('CONTINUOUS_INTEGRATION', raising=False)
        monkeypatch.delenv('TRAVIS', raising=False)
        monkeypatch.delenv('APPVEYOR', raising=False)

        expect(services.detected()) == False
开发者ID:jacebrowning,项目名称:coverage-space-cli,代码行数:7,代码来源:test_services.py


示例7: it_expects_containment

 def it_expects_containment(self):
     expect([1]).contains(1)
     def _fails():
         expect([2]).contains(1)
     assert_raises(AssertionError, _fails)
     assert fail_msg(_fails) == (
         "Expected [2] to contain 1 but it didn't")
开发者ID:JNRowe,项目名称:expecter,代码行数:7,代码来源:test_expecter.py


示例8: test___repr__

 def test___repr__(self):
     expect(repr(Cell(4, 52.015, -0.221, 21, 46, 40000, 10, 0, 1,
                      datetime.datetime(2008, 4, 15, 15, 21, 35),
                      datetime.datetime(2008, 4, 15, 15, 28, 49)))) == \
         ('Cell(4, 52.015, -0.221, 21, 46, 40000, 10, 0, 1, '
          'datetime.datetime(2008, 4, 15, 15, 21, 35), '
          'datetime.datetime(2008, 4, 15, 15, 28, 49))')
开发者ID:encukou,项目名称:upoints,代码行数:7,代码来源:test_cellid.py


示例9: test_relevant_changes

 def test_relevant_changes(self):
     ok = SprinterChange(pk=1, component='Forms')
     not_ok = SprinterChange(pk=2, component='ORM')
     achievement = Achievement(component='Forms')
     changes = [ok, not_ok]
     filtered = achievement.relevant_changes(changes)
     expect(filtered) == [ok]
开发者ID:asendecka,项目名称:django-sprinter,代码行数:7,代码来源:test_models.py


示例10: test_get

    def test_get(self, outbox_class):
        outbox_class.return_value.get.return_value = self.mail

        response = self.client.get(self._reverse())

        expect(response.status_code) == 200
        expect(response.context['mail']) == self.mail
开发者ID:tswicegood,项目名称:django-outbox,代码行数:7,代码来源:test_views.py


示例11: test_import_locations

 def test_import_locations(self):
     trackpoints = Trackpoints(open("tests/data/gpx_tracks"))
     data = list(map(str, sorted(trackpoints[0], key=lambda x: x.name)))
     expect(data[0]) == """Home (52°00'54"N, 000°13'15"W on 2008-07-26T00:00:00+00:00) [My place]"""
     expect(
         data[1]
     ) == """MSR (52°10'01"N, 000°23'24"E on 2008-07-27T00:00:00+00:00) [Microsoft Research, Cambridge]"""
开发者ID:JNRowe,项目名称:upoints,代码行数:7,代码来源:test_gpx.py


示例12: it_redirects_to_lose_alt_when_bad_url

        def it_redirects_to_lose_alt_when_bad_url(client):
            url = "http:invalid"
            response = client.get("/sad-biden/hello.jpg?alt=" + url)

            expect(response.status_code) == 302
            expect(load(response, as_json=False)).contains(
                '<a href="/sad-biden/hello.jpg">')
开发者ID:vanossj,项目名称:memegen,代码行数:7,代码来源:test_images.py


示例13: it_redirects_to_lose_alt_when_unknown_url

        def it_redirects_to_lose_alt_when_unknown_url(client):
            url = "http://example.com/not/a/real/image.jpg"
            response = client.get("/sad-biden/hello.jpg?alt=" + url)

            expect(response.status_code) == 302
            expect(load(response, as_json=False)).contains(
                '<a href="/sad-biden/hello.jpg">')
开发者ID:vanossj,项目名称:memegen,代码行数:7,代码来源:test_images.py


示例14: test_can_read_from_properties

 def test_can_read_from_properties(self):
     class C(SimpleDelegator):
         @property
         def prop(self):
             return 123
     c = C(mock.Mock())
     expect(c.prop) == 123
开发者ID:sumeet,项目名称:simpledelegator,代码行数:7,代码来源:test.py


示例15: it_can_compare_bytes

 def it_can_compare_bytes(self):
     null = bytes((0,))
     expect(null) == null
     data = bytes(range(9, 32))
     def _fails():
         expect(data) == data + null
     assert_raises(AssertionError, _fails)
开发者ID:CharString,项目名称:expecter,代码行数:7,代码来源:test_expecter.py


示例16: it_returns_an_error_when_no_metrics_specified

        def it_returns_an_error_when_no_metrics_specified(client):
            status, data = load(client.put("/my_owner/my_repo"))

            expect(status) == 400
            expect(data) == {
                'message': "No metrics provided."
            }
开发者ID:jacebrowning,项目名称:coverage-space,代码行数:7,代码来源:test_views_project.py


示例17: test_dump_zone_file

 def test_dump_zone_file(self):
     zones = Zones(open("tests/data/timezones"))
     expect(Zones.dump_zone_file(zones)) == [
         "AN\t+121100-0690000\tAmerica/Curacao",
         "AO\t-084800+0131400\tAfrica/Luanda",
         "AQ\t-775000+1663600\tAntarctica/McMurdo\tMcMurdo Station, Ross Island",
     ]
开发者ID:JNRowe,项目名称:upoints,代码行数:7,代码来源:test_tzdata.py


示例18: it_returns_an_error_for_unknown_projects

        def it_returns_an_error_for_unknown_projects(client):
            status, data = load(client.get("/unknown/project"))

            expect(status) == 404
            expect(data) == {
                'message': "No such project."
            }
开发者ID:jacebrowning,项目名称:coverage-space,代码行数:7,代码来源:test_views_project.py


示例19: with_dashes

    def with_dashes(client):
        status, data = load(client.get(
            "/api/templates/iw/HelloThere_World/How-areYOU"))

        expect(status) == 302
        expect(data).contains(
            '<a href="/api/templates/iw/hello_there_world/how_are_you">')
开发者ID:jacebrowning,项目名称:memegen,代码行数:7,代码来源:test_api_links.py


示例20: test_midpoint

 def test_midpoint(self):
     expect(Point(52.015, -0.221).midpoint(Point(52.6333, -2.5))) == \
         Point(52.329631405407014, -1.3525368605590993, 'metric', 'degrees',
               0)
     expect(Point(36.1200, -86.6700).midpoint(Point(33.9400, -118.4000))) == \
         Point(36.08239491900365, -102.75217370539663, 'metric', 'degrees',
               0)
开发者ID:encukou,项目名称:upoints,代码行数:7,代码来源:test_point.py



注:本文中的expecter.expect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python expect.raises函数代码示例发布时间:2022-05-24
下一篇:
Python expect.Expect类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap