当前位置: 首页>>代码示例>>Python>>正文


Python hamcrest.greater_than方法代码示例

本文整理汇总了Python中hamcrest.greater_than方法的典型用法代码示例。如果您正苦于以下问题:Python hamcrest.greater_than方法的具体用法?Python hamcrest.greater_than怎么用?Python hamcrest.greater_than使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hamcrest的用法示例。


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

示例1: test_write_memory_with_delay

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_write_memory_with_delay(self, t):
        t.child.timeout = 10
        enable(t)

        t.write("copy running-config startup-config")

        t.readln("")
        t.readln("This operation may take a few minutes.")
        t.readln("Management interfaces will not be available during this time.")
        t.readln("")
        t.read("Are you sure you want to save? (y/n) ")
        start_time = time()
        t.write_raw("y")
        t.readln("")
        t.readln("")
        t.readln("Configuration Saved!")
        end_time = time()
        t.read("my_switch#")

        assert_that((end_time - start_time), greater_than(COMMIT_DELAY)) 
开发者ID:internap,项目名称:fake-switches,代码行数:22,代码来源:test_enabled_with_commit_delay.py

示例2: test_duration

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_duration(allured_testdir, snipped):
    allured_testdir.testdir.makepyfile("""
        def test_duration_example():
            {snipped}
    """.format(snipped=snipped))

    timestamp = now()
    allured_testdir.run_with_allure()

    assert_that(allured_testdir.allure_report,
                has_test_case("test_duration_example",
                              all_of(
                                  has_entry("start", greater_than(timestamp)),
                                  has_entry("stop", greater_than(timestamp))
                              ))
                ) 
开发者ID:allure-framework,项目名称:allure-python,代码行数:18,代码来源:duration_time_test.py

示例3: test_with_fixture_duration

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_with_fixture_duration(allured_testdir, snipped):
    allured_testdir.testdir.makepyfile("""
        import pytest

        @pytest.fixture
        def fixture():
            {snipped}

        def test_with_fixture_duration_example(fixture):
            pass
    """.format(snipped=snipped))

    timestamp = now()
    allured_testdir.run_with_allure()

    assert_that(allured_testdir.allure_report,
                has_test_case("test_with_fixture_duration_example",
                              all_of(
                                  has_entry("start", greater_than(timestamp)),
                                  has_entry("stop", greater_than(timestamp))
                              ))
                ) 
开发者ID:allure-framework,项目名称:allure-python,代码行数:24,代码来源:duration_time_test.py

示例4: test_with_fixture_finalizer_duration

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_with_fixture_finalizer_duration(allured_testdir, snipped):
    allured_testdir.testdir.makepyfile("""
        import pytest

        @pytest.fixture
        def fixture(request):
            def finalizer():
                {snipped}
            request.addfinalizef(finalizer)

        def test_with_fixture_finalizer_duration(fixture):
            pass
    """.format(snipped=snipped))

    timestamp = now()
    allured_testdir.run_with_allure()

    assert_that(allured_testdir.allure_report,
                has_test_case("test_with_fixture_finalizer_duration",
                              all_of(
                                  has_entry("start", greater_than(timestamp)),
                                  has_entry("stop", greater_than(timestamp))
                              ))
                ) 
开发者ID:allure-framework,项目名称:allure-python,代码行数:26,代码来源:duration_time_test.py

示例5: test_returns_a_dictionary_of_various_hardware_and_software_versions

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_returns_a_dictionary_of_various_hardware_and_software_versions(self):
        versions = self.client.get_versions()

        assert_that(isinstance(versions, dict))
        assert_that(len(versions), greater_than(0)) 
开发者ID:internap,项目名称:netman,代码行数:7,代码来源:get_versions_test.py

示例6: test_feature_list

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_feature_list():
    feature = vnx.get_pool_feature()
    assert_that(feature.existed, equal_to(True))
    assert_that(len(feature.available_disks), greater_than(0)) 
开发者ID:emc-openstack,项目名称:storops,代码行数:6,代码来源:test_system.py

示例7: test_get_issue_comments

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_get_issue_comments(self):
        self.connection = TestGetIssues.connection
        project = os.getenv('TEST_PROJECT', '')
        issues = self.connection.get_issues(project, 'for: me #unresolved', 0, 10)
        pprint.PrettyPrinter(indent=0).pprint(issues)
        count = 0
        for issue in issues:
            comments = issue.get_comments()
            pprint.PrettyPrinter(indent=4).pprint(comments)
            count += len(comments)

        assert_that(count, is_(greater_than(0))) 
开发者ID:devopshq,项目名称:youtrack,代码行数:14,代码来源:test_get_issues.py

示例8: test_get_issue_attachments

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_get_issue_attachments(self):
        self.connection = TestGetIssues.connection
        project = os.getenv('TEST_PROJECT', '')
        issues = self.connection.get_issues(project, 'for: me #unresolved', 0, 10)
        pprint.PrettyPrinter(indent=0).pprint(issues)
        count = 0
        for issue in issues:
            attachments = issue.get_attachments()
            pprint.PrettyPrinter(indent=4).pprint(attachments)
            count += len(attachments)

        assert_that(count, is_(greater_than(0))) 
开发者ID:devopshq,项目名称:youtrack,代码行数:14,代码来源:test_get_issues.py

示例9: test_get_issue_attachments_content

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_get_issue_attachments_content(self):
        self.connection = TestGetIssues.connection
        project = os.getenv('TEST_PROJECT', '')
        issues = self.connection.get_issues(project, 'for: me #unresolved', 0, 10)
        pprint.PrettyPrinter(indent=0).pprint(issues)
        count = 0
        for issue in issues:
            # attachments = issue.get_attachments()
            attachments = self.connection.get_attachments(issue['id'])
            pprint.PrettyPrinter(indent=4).pprint(attachments)
            for attachment in attachments:
                content = attachment.get_content()
                count += content.length

        assert_that(count, is_(greater_than(0))) 
开发者ID:devopshq,项目名称:youtrack,代码行数:17,代码来源:test_get_issues.py

示例10: test_write_memory

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_write_memory(self, t):
        enable(t)
        t.child.timeout = 10

        start_time = time.time()

        t.write("write memory")
        t.read("SSH@my_switch#")

        end_time = time.time()

        assert_that((end_time - start_time), greater_than(COMMIT_DELAY)) 
开发者ID:internap,项目名称:fake-switches,代码行数:14,代码来源:test_brocade_switch_protocol_with_commit_delay.py

示例11: test_write_memory_with_commit_delay

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_write_memory_with_commit_delay(self, t):
        t.child.timeout = 10
        enable(t)
        start_time = time()
        t.write("write memory")
        t.readln("Building configuration...")
        t.readln("OK")
        t.read("my_switch#")
        end_time = time()

        assert_that((end_time - start_time), greater_than(COMMIT_DELAY)) 
开发者ID:internap,项目名称:fake-switches,代码行数:13,代码来源:test_cisco_switch_protocol_with_commit_delay.py

示例12: test_write_memory_with_commit_delay

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_write_memory_with_commit_delay(self, t):
        t.child.timeout = 10
        enable(t)
        start_time = time()
        t.write("write memory")
        t.readln("Copy completed successfully.")
        t.read("my_arista#")
        end_time = time()

        assert_that((end_time - start_time), greater_than(COMMIT_DELAY)) 
开发者ID:internap,项目名称:fake-switches,代码行数:12,代码来源:test_arista_switch_protocol_with_commit_delay.py

示例13: test_lock_edit_candidate_add_vlan_and_commit_with_commit_delay

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import greater_than [as 别名]
def test_lock_edit_candidate_add_vlan_and_commit_with_commit_delay(self):
        with self.nc.locked(target='candidate'):
            result = self.nc.edit_config(target='candidate', config=dict_2_etree({
                "config": {
                    "configuration": {
                        "vlans": {
                            "vlan": {
                                "name": "VLAN2999",
                                }
                        }
                    }
                }}))
            assert_that(result.xpath("//rpc-reply/ok"), has_length(1))

            result = self.nc.commit()
            assert_that(result.xpath("//rpc-reply/ok"), has_length(1))

        result = self.nc.get_config(source="running")

        assert_that(result.xpath("data/configuration/vlans/vlan"), has_length(1))

        self.edit({
            "vlans": {
                "vlan": {
                    XML_ATTRIBUTES: {"operation": "delete"},
                    "name": "VLAN2999"
                }
            }
        })

        start_time = time()
        self.nc.commit()
        end_time = time()

        result = self.nc.get_config(source="running")

        assert_that(result.xpath("data/configuration/vlans/vlan"), has_length(0))
        assert_that((end_time - start_time), greater_than(COMMIT_DELAY)) 
开发者ID:internap,项目名称:fake-switches,代码行数:40,代码来源:juniper_base_protocol_with_commit_delay_test.py


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