예제 #1
0
    def test_should_remove_infix_glob_patterns(self):
        formatted = formatters.format_module_name(
            'test_module.py',
            ['test_*.py']
        )

        assert formatted == 'module'
예제 #2
0
    def test_should_remove_folders_from_the_name(self, patterns):
        formatted = formatters.format_module_name(
            'tests/sub/test_module.py',
            patterns
        )

        assert formatted == 'module'
예제 #3
0
    def test_parse_should_parse_node_id_attributes(self, pattern_config):
        nodeid = 'tests/test_module.py::test_title'
        node = Node.parse(nodeid, pattern_config)

        assert node.title == formatters.format_title('test_title',
                                                     pattern_config.functions)
        assert node.module_name == (
            formatters.format_module_name('tests/test_module.py',
                                          pattern_config.files)
        )
예제 #4
0
 def test_should_remove_test_pattern(self, patterns):
     assert formatters.format_module_name('test_a_thing.py', patterns) == (
         'a thing'
     )
     assert formatters.format_module_name('a_test.py', patterns) == 'a test'
예제 #5
0
 def test_should_replace_underscores_with_spaces(self, patterns):
     assert formatters.format_module_name('a_test_name', patterns) == (
         'a test name'
     )
예제 #6
0
 def test_should_remove_py_file_pattern(self, patterns):
     assert formatters.format_module_name('pymodule.py', patterns) == (
         'pymodule'
     )