def test_is_valid_extension_false(self): wrong_extensions = ['.wrong', '.squirrel', '.incorrect'] file_path = path.join('test_aspx', 'test.aspx') for wrong_extension in wrong_extensions: file_regex_map = FileRegexMap(_path=file_path) file_regex_map.extension = wrong_extension self.assertFalse(file_regex_map.is_valid_extension())
def test_is_valid_extension_whitespace(self): file_paths = [path.join('test_aspx', 'test.aspx '), path.join('test_jinja', 'test.jinja2 ')] for _path in file_paths: file_regex_map = FileRegexMap(_path=_path) self.assertTrue(file_regex_map.is_valid_extension(), msg=_path)