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


Python TestCase.assertFalse方法代码示例

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


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

示例1: test_hideHud

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
 def test_hideHud(self):
     self.game.showHud('playerHud')
     TestCase.assertTrue(self,
                         self.game.tilemap.layers['playerHud'].visible)
     self.game.hideHud('playerHud')
     TestCase.assertFalse(self,
                          self.game.tilemap.layers['playerHud'].visible)
开发者ID:Projet5001,项目名称:projet5001-pyhton,代码行数:9,代码来源:test_game.py

示例2: check_both_single_and_multiple_line_source

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
 def check_both_single_and_multiple_line_source(
         self,
         put: unittest.TestCase,
         first_source_line_instruction_argument_source_template: str,
         act_phase_source_lines: list,
         expected_cmd_and_args: ValueAssertion,
         hds_contents: home_populators.HomePopulator = home_populators.empty()):
     instruction_argument_source = first_source_line_instruction_argument_source_template.format_map(
         self.format_map_for_template_string)
     for source, source_assertion in equivalent_source_variants_with_assertion(put, instruction_argument_source):
         # ARRANGE #
         os_process_executor = AtcOsProcessExecutorThatRecordsArguments()
         arrangement = Arrangement(source,
                                   act_phase_source_lines,
                                   atc_os_process_executor=os_process_executor,
                                   hds_contents=hds_contents)
         expectation = Expectation(source_after_parse=source_assertion)
         # ACT #
         check(put, arrangement, expectation)
         # ASSERT #
         put.assertFalse(os_process_executor.command.shell,
                         'Command should not indicate shell execution')
         actual_cmd_and_args = os_process_executor.command.args
         put.assertIsInstance(actual_cmd_and_args, list,
                              'Arguments of command to execute should be a list of arguments')
         put.assertTrue(len(actual_cmd_and_args) > 0,
                        'List of arguments is expected to contain at least the file|interpreter argument')
         expected_cmd_and_args.apply_with_message(put, actual_cmd_and_args, 'actual_cmd_and_args')
开发者ID:emilkarlen,项目名称:exactly,代码行数:30,代码来源:executable_file.py

示例3: _apply

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
 def _apply(self,
            put: unittest.TestCase,
            value,
            message_builder: asrt.MessageBuilder):
     put.assertIsInstance(value, spe.ResultAndStderr)
     put.assertFalse(value.result.is_success,
                     message_builder.apply('Result is expected to indicate failure'))
开发者ID:emilkarlen,项目名称:exactly,代码行数:9,代码来源:sub_process_result_check.py

示例4: _apply

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
 def _apply(self,
            put: unittest.TestCase,
            value: T,
            message_builder: MessageBuilder = MessageBuilder()):
     msg = message_builder.apply(self.message)
     if self.expected:
         put.assertTrue(value, msg)
     else:
         put.assertFalse(value, msg)
开发者ID:emilkarlen,项目名称:exactly,代码行数:11,代码来源:value_assertion.py

示例5: _assert_source_is_not_at_eof_and_has_current_whole_line

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def _assert_source_is_not_at_eof_and_has_current_whole_line(put: unittest.TestCase,
                                                            source: ParseSource,
                                                            expected_current_line: str):
    put.assertTrue(source.has_current_line,
                   'There should be remaining lines in the source')
    put.assertFalse(source.is_at_eof,
                    'There should be remaining source')
    put.assertEqual(expected_current_line,
                    source.current_line_text,
                    'Should should have given current line')
    put.assertEqual(expected_current_line,
                    source.remaining_part_of_current_line,
                    'Current line should be identical to remaining-part-of-current-line')
开发者ID:emilkarlen,项目名称:exactly,代码行数:15,代码来源:act_phase_source_parser.py

示例6: _apply

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
    def _apply(self,
               put: unittest.TestCase,
               actual: Pattern,
               message_builder: MessageBuilder):
        put.assertEqual(self.pattern_string,
                        actual.pattern,
                        'regex pattern string')
        for matching_string in self.matching_string_list:
            put.assertTrue(bool(actual.search(matching_string)),
                           'reg-ex should match "{}"'.format(matching_string))

        put.assertFalse(bool(actual.search(self.non_matching_string)),
                        'reg-ex should not match "{}"'.format(self.non_matching_string))
开发者ID:emilkarlen,项目名称:exactly,代码行数:15,代码来源:parse_regex.py

示例7: _apply

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
    def _apply(self,
               put: unittest.TestCase,
               value,
               message_builder: asrt.MessageBuilder):
        put.assertIsInstance(value, SymbolStringFragmentResolver)
        assert isinstance(value, SymbolStringFragmentResolver)  # Type info for IDE

        put.assertFalse(value.is_string_constant,
                        'is_string_constant')

        put.assertEqual(self.expected.symbol_name,
                        value.symbol_name,
                        'symbol_name')
开发者ID:emilkarlen,项目名称:exactly,代码行数:15,代码来源:concrete_value_assertions.py

示例8: log_dir_is_correct_for_each_phase

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def log_dir_is_correct_for_each_phase(recordings: dict,
                                      put: unittest.TestCase,
                                      actual: Result):
    put.assertFalse(actual.partial_result.is_failure)
    sds = actual.sds
    expected = {
        PhaseEnum.SETUP: sds_log_phase_dir(sds, phase_identifier.SETUP.identifier),
        PhaseEnum.BEFORE_ASSERT: sds_log_phase_dir(sds, phase_identifier.BEFORE_ASSERT.identifier),
        PhaseEnum.ASSERT: sds_log_phase_dir(sds, phase_identifier.ASSERT.identifier),
        PhaseEnum.CLEANUP: sds_log_phase_dir(sds, phase_identifier.CLEANUP.identifier),
    }
    put.assertDictEqual(expected,
                        recordings,
                        'Log directory per phase')
开发者ID:emilkarlen,项目名称:exactly,代码行数:16,代码来源:instruction_environment.py

示例9: assert_equal_failure_details

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def assert_equal_failure_details(unit_tc: unittest.TestCase,
                                 expected: FailureDetails,
                                 actual: FailureDetails):
    if expected.is_only_failure_message:
        unit_tc.assertTrue(actual.is_only_failure_message,
                           'An error message is expected')
        unit_tc.assertEqual(expected.failure_message,
                            actual.failure_message,
                            'The failure message should be the expected')
    else:
        unit_tc.assertFalse(actual.is_only_failure_message,
                            'An exception is expected')
        unit_tc.assertEqual(expected.exception,
                            actual.exception,
                            'The exception should be the expected')
开发者ID:emilkarlen,项目名称:exactly,代码行数:17,代码来源:single_instruction_executor.py

示例10: _expect_string

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def _expect_string(put: unittest.TestCase,
                   source: ParseSource,
                   expectation: ExpectedString):
    # ACT #
    actual = sut.parse_from_parse_source(source)
    # ASSERT #
    put.assertIs(string_or_file.SourceType.STRING,
                 actual.source_type,
                 'source type')
    put.assertFalse(actual.is_file_ref,
                    'is_file_ref')
    assertion_on_here_doc = asrt_string.matches_primitive_string(asrt.equals(expectation.resolved_str),
                                                                 expectation.common.symbol_references,
                                                                 expectation.common.symbol_table)
    assertion_on_here_doc.apply_with_message(put, actual.string_resolver,
                                             'string_resolver')
    _expect_common(put, source, actual,
                   expectation.common)
开发者ID:emilkarlen,项目名称:exactly,代码行数:20,代码来源:parse_here_doc_or_file_ref.py

示例11: _expect_here_doc

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def _expect_here_doc(put: unittest.TestCase,
                     source: ParseSource,
                     expectation: ExpectedHereDoc):
    # ACT #
    actual = sut.parse_from_parse_source(source)
    # ASSERT #
    put.assertIs(string_or_file.SourceType.HERE_DOC,
                 actual.source_type,
                 'source type')
    put.assertFalse(actual.is_file_ref,
                    'is_file_ref')
    assertion_on_here_doc = asrt_hd.matches_resolved_value(expectation.resolved_here_doc_lines,
                                                           expectation.common.symbol_references,
                                                           expectation.common.symbol_table)
    assertion_on_here_doc.apply_with_message(put, actual.string_resolver,
                                             'here_document')
    _expect_common(put, source, actual,
                   expectation.common)
开发者ID:emilkarlen,项目名称:exactly,代码行数:20,代码来源:parse_here_doc_or_file_ref.py

示例12: _assert_source_is_at_end

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def _assert_source_is_at_end(put: unittest.TestCase, source: ParseSource):
    put.assertFalse(source.has_current_line,
                    'There should be no remaining lines in the source')
    put.assertTrue(source.is_at_eof,
                   'There should be no remaining data in the source')
开发者ID:emilkarlen,项目名称:exactly,代码行数:7,代码来源:act_phase_source_parser.py

示例13: _apply

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
 def _apply(self,
            put: unittest.TestCase,
            value: pathlib.Path,
            message_builder: MessageBuilder):
     put.assertFalse(value.exists(),
                     message_builder.msg_for_sub_component('exists'))
开发者ID:emilkarlen,项目名称:exactly,代码行数:8,代码来源:file_checks.py

示例14: assert_is_not_null

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import assertFalse [as 别名]
def assert_is_not_null(put: unittest.TestCase, actual: sut.TokenStream):
    put.assertFalse(actual.is_null,
                    'is null')
    put.assertIsNot(LookAheadState.NULL,
                    actual.look_ahead_state,
                    'look ahead state')
开发者ID:emilkarlen,项目名称:exactly,代码行数:8,代码来源:token_stream.py


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