def test_search_for_javascript_resources_in_paths_without_any_search_paths_returns_none( self): test_env = Paths(self.test_env_dir, include_cwd=False) path_to_test_file = os.path.join(self.test_env_dir, 'test.css') helpers.create_files(path_to_test_file) resources = Resource.find_all_of_type_in_paths('javascript', test_env) self.assertEquals(None, resources)
def test_find_all_javascript_resources_in_the_paths(self): paths_to_test_files = [os.path.join(self.test_env_dir, 'test.js'), os.path.join(self.test_env_dir, 'test.css'), os.path.join(self.test_env_dir, 'test.html')] helpers.create_files(paths_to_test_files) resources = Resource.find_all_of_type_in_paths('javascript', Paths(self.test_env_dir, include_cwd=False)) helpers.clean_up_files(paths_to_test_files) self.assertEquals(1, len(resources), 'One and only one javascript file should be found')
def test_find_all_javascript_resources_in_the_paths(self): paths_to_test_files = [ os.path.join(self.test_env_dir, 'test.js'), os.path.join(self.test_env_dir, 'test.css'), os.path.join(self.test_env_dir, 'test.html') ] helpers.create_files(paths_to_test_files) resources = Resource.find_all_of_type_in_paths( 'javascript', Paths(self.test_env_dir, include_cwd=False)) helpers.clean_up_files(paths_to_test_files) self.assertEquals(1, len(resources), 'One and only one javascript file should be found')
def test_search_for_javascript_resources_in_paths_without_any_search_paths_returns_none(self): test_env = Paths(self.test_env_dir, include_cwd=False) path_to_test_file = os.path.join(self.test_env_dir, 'test.css') helpers.create_files(path_to_test_file) resources = Resource.find_all_of_type_in_paths('javascript', test_env) self.assertEquals(None, resources)