def test_match_with_filename(self): success_case = Helper.join_path((self.base_path, 'hello', 'world', 'file.foo')) file_path = Helper.join_path((self.base_path, 'hello', 'world', 'file.foo')) wrong_cases = [ Helper.join_path((self.base_path, 'hello', 'file.foo')), Helper.join_path((self.base_path, 'hello', 'world', 'bar.txt')), Helper.join_path((self.base_path, 'hello', '.txt')), Helper.join_path((self.base_path, 'hello', 'any_name', 'file.foo')), Helper.join_path((self.base_path, 'hello', 'world', 'file', '.foo')) ] self.assertTrue(Helper.match_with_filename(success_case, file_path)) for w in wrong_cases: self.assertFalse(Helper.match_with_filename(w, file_path))
def test_match_with_filename(self): success_case = Helper.join_path( (self.base_path, 'hello', 'world', 'file.foo')) file_path = Helper.join_path( (self.base_path, 'hello', 'world', 'file.foo')) wrong_cases = [ Helper.join_path((self.base_path, 'hello', 'file.foo')), Helper.join_path((self.base_path, 'hello', 'world', 'bar.txt')), Helper.join_path((self.base_path, 'hello', '.txt')), Helper.join_path( (self.base_path, 'hello', 'any_name', 'file.foo')), Helper.join_path( (self.base_path, 'hello', 'world', 'file', '.foo')) ] self.assertTrue(Helper.match_with_filename(success_case, file_path)) for w in wrong_cases: self.assertFalse(Helper.match_with_filename(w, file_path))