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


Python hamcrest.starts_with方法代码示例

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


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

示例1: validate_monthly_account

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def validate_monthly_account(context):
    acct_repository = AccountRepository(context.db)
    membership = acct_repository.get_active_account_membership(
        context.accounts['foo'].id
    )
    assert_that(
        membership.type,
        equal_to(MONTHLY_MEMBERSHIP)
    )
    assert_that(membership.payment_account_id, starts_with('cus'))
    assert_that(membership.start_date, equal_to(date.today()))
    assert_that(membership.end_date, none()) 
开发者ID:MycroftAI,项目名称:selene-backend,代码行数:14,代码来源:profile.py

示例2: yearly_account

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def yearly_account(context):
    acct_repository = AccountRepository(context.db)
    membership = acct_repository.get_active_account_membership(
        context.accounts['foo'].id
    )
    assert_that(membership.type, equal_to(YEARLY_MEMBERSHIP))
    assert_that(membership.payment_account_id, starts_with('cus')) 
开发者ID:MycroftAI,项目名称:selene-backend,代码行数:9,代码来源:profile.py

示例3: test_connect_timeout

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def test_connect_timeout(self):
        with self.assertRaises(ConnectTimeout) as expect:
            self.client("10.0.0.0", "whatever", "whatever", connect_timeout=1)

        assert_that(str(expect.exception), starts_with("Timed out while connecting to 10.0.0.0 on port")) 
开发者ID:internap,项目名称:netman,代码行数:7,代码来源:terminal_client_test.py

示例4: test_get_type_fields

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def test_get_type_fields(self):
        t = UnityType(_id='type')
        assert_that(t.fields_str, starts_with(
            'name,description,documentation,type,attributes.name')) 
开发者ID:emc-openstack,项目名称:storops,代码行数:6,代码来源:test_type_resource.py

示例5: test_fields_str

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def test_fields_str(self):
        t = UnityType(_id='lun', cli=t_rest())
        assert_that(t.fields_str, starts_with('auSize,creationTime,')) 
开发者ID:emc-openstack,项目名称:storops,代码行数:5,代码来源:test_type_resource.py

示例6: test_fake_switches_entrypoint_cisco_generic

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def test_fake_switches_entrypoint_cisco_generic(self):
        p = subprocess.Popen(get_base_args() + ["--listen-host", TEST_BIND_HOST,
                                                "--listen-port", TEST_BIND_PORT])
        time.sleep(1)
        handshake = connect_and_read_bytes(TEST_BIND_HOST, TEST_BIND_PORT,
                                           byte_count=8, retry_count=10)

        p.terminate()

        assert_that(handshake, starts_with('SSH-2.0')) 
开发者ID:internap,项目名称:fake-switches,代码行数:12,代码来源:test_main.py

示例7: has_test_case

# 需要导入模块: import hamcrest [as 别名]
# 或者: from hamcrest import starts_with [as 别名]
def has_test_case(name, *matchers):
    return has_property('test_cases',
                        has_item(
                            all_of(
                                any_of(
                                    has_entry('fullName', ends_with(name)),
                                    has_entry('name', starts_with(name))
                                ),
                                *matchers
                            )
                        )
                        ) 
开发者ID:allure-framework,项目名称:allure-python,代码行数:14,代码来源:report.py


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