def test_find_if_does_not_exist(self): finder = FileSystemFinder(('/first', '/second', '/third')) finder.find_all = Mock(return_value=()) with self.assertRaises(FileNotFound): finder.find('js/script.js') finder.find_all.assert_called_once_with('js/script.js')
def test_find_if_exists(self): finder = FileSystemFinder(('/first', '/second', '/third')) finder.find_all = Mock(return_value=('/second/js/script.js', '/third/js/script.js')) self.assertEqual(finder.find('js/script.js'), '/second/js/script.js') finder.find_all.assert_called_once_with('js/script.js')
def test_find_if_exists(self): finder = FileSystemFinder(('/first', '/second', '/third')) finder.find_all = Mock(return_value=( '/second/js/script.js', '/third/js/script.js')) self.assertEqual(finder.find('js/script.js'), '/second/js/script.js') finder.find_all.assert_called_once_with('js/script.js')
def test_find_if_does_not_exist(self): finder = FileSystemFinder(("/first", "/second", "/third")) finder.find_all = Mock(return_value=()) with self.assertRaises(FileNotFound): finder.find("js/script.js") finder.find_all.assert_called_once_with("js/script.js")
def test_find_if_exists(self): finder = FileSystemFinder(("/first", "/second", "/third")) finder.find_all = Mock(return_value=("/second/js/script.js", "/third/js/script.js")) self.assertEqual(finder.find("js/script.js"), "/second/js/script.js") finder.find_all.assert_called_once_with("js/script.js")