本文整理匯總了Python中hamcrest.not_方法的典型用法代碼示例。如果您正苦於以下問題:Python hamcrest.not_方法的具體用法?Python hamcrest.not_怎麽用?Python hamcrest.not_使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hamcrest
的用法示例。
在下文中一共展示了hamcrest.not_方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_updated_skill_manifest
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def get_updated_skill_manifest(context):
device_skill_repo = DeviceSkillRepository(context.db)
skill_manifest = device_skill_repo.get_skill_manifest_for_device(
context.device_id
)
assert_that(len(skill_manifest), equal_to(1))
manifest_skill = skill_manifest[0]
assert_that(manifest_skill, not_(equal_to(context.manifest_skill)))
manifest_skill.update_ts = context.update_ts
assert_that(manifest_skill, (equal_to(context.manifest_skill)))
示例2: get_skill_manifest_no_device_specific
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def get_skill_manifest_no_device_specific(context):
device_skill_repo = DeviceSkillRepository(context.db)
skill_manifest = device_skill_repo.get_skill_manifest_for_device(
context.device_id
)
assert_that(len(skill_manifest), equal_to(1))
remaining_skill = skill_manifest[0]
assert_that(
remaining_skill.skill_gid,
not_(equal_to(context.device_specific_skill.skill_gid))
)
示例3: test_tables_broken_schema
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def test_tables_broken_schema(self, simpsons_broken_dataset):
assert_that(calling(simpsons_broken_dataset.tables.get).with_args(
'simpsons_episodes'), not_(raises(Exception)))
assert_that(simpsons_broken_dataset.tables.get('simpsons_episodes'),
not_none())
示例4: test_dataframe_broken_schema
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def test_dataframe_broken_schema(self, simpsons_broken_dataset):
assert_that(calling(simpsons_broken_dataset.dataframes.get).with_args(
'simpsons_episodes'), not_(raises(Exception)))
assert_that(simpsons_broken_dataset.dataframes.get(
'simpsons_episodes'), not_none())
示例5: test_removes_bond_from_get_bonds
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def test_removes_bond_from_get_bonds(self):
self.client.remove_bond(42)
assert_that(self.client.get_bonds(), not_(has_item(42)))
示例6: test_removes_interface_from_bond
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def test_removes_interface_from_bond(self):
self.client.remove_interface_from_bond(self.test_port)
bond = self.client.get_bond(42)
assert_that(bond.members, not_(has_item(self.test_port)))
示例7: check_queues_empty
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def check_queues_empty(context):
drain_message_response = sqs.receive_message(QueueUrl=context.drain_url)
termination_message_response = sqs.receive_message(QueueUrl=context.termination_url)
warning_message_response = sqs.receive_message(QueueUrl=context.warning_url)
assert_that(drain_message_response, not_(has_key('Messages')))
assert_that(termination_message_response, not_(has_key('Messages')))
assert_that(warning_message_response, not_(has_key('Messages')))
示例8: _matches
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def _matches(self, other):
assert_that(other, is_(not_(None)), "Lookup node doesn't exist")
nodes = other.xpath(self.xpath)
assert_that(nodes, has_length(1), "Nodes length should be 1 element")
assert_that(nodes[0].text, self.matcher)
return True
示例9: step_scenario
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def step_scenario(context, scenario):
matcher = partial(match, not_, has_test_case, scenario)
context.scenario = matcher
assert_that(context.allure_report, matcher())
示例10: step_no_before_fixture
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def step_no_before_fixture(context, fixture):
context_matcher = context.scenario
matcher = partial(context_matcher, not_, has_container, context.allure_report, has_before, fixture)
assert_that(context.allure_report, matcher())
示例11: step_impl
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def step_impl(context, fixture):
context_matcher = context.scenario
matcher = partial(context_matcher, not_, has_container, context.allure_report, has_after, fixture)
assert_that(context.allure_report, matcher())
示例12: should_not_has_tag
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def should_not_has_tag(conetxt, tag):
allure_report, test_case_matcher = conetxt
tag_matcher = partial(test_case_matcher, not_, has_tag, tag)
assert_that(allure_report, tag_matcher())
示例13: should_not_has_severity
# 需要導入模塊: import hamcrest [as 別名]
# 或者: from hamcrest import not_ [as 別名]
def should_not_has_severity(context):
allure_report, test_case_matcher = context
severity_matcher = partial(test_case_matcher, not_, has_severity, anything)
assert_that(allure_report, severity_matcher())