本文整理汇总了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())