當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。