예제 #1
0
 def test_should_only_return_py_suffix(self):
     when(os).walk("spam").thenReturn([("spam", [], self.fake_dir_contents)
                                       ])
     expected_result = ["spam/spam.py", "spam/eggs.py"]
     actual_result = set(discover_files("spam", ".py"))
     self.assertEquals(set(expected_result), actual_result)
     verify(os).walk("spam")
예제 #2
0
 def test_should_only_return_py_suffix(self):
     when(os).walk("spam").thenReturn([("spam", [], self.fake_dir_contents)])
     expected_result = ["spam/spam.py", "spam/eggs.py"]
     actual_result = set(discover_files("spam", ".py"))
     self.assertEquals(set(expected_result), actual_result)
     verify(os).walk("spam")
예제 #3
0
 def test_should_only_return_py_suffix(self, walk):
     expected_result = ["spam/spam.py", "spam/eggs.py"]
     actual_result = set(discover_files("spam", ".py"))
     self.assertEquals(set(expected_result), actual_result)
     walk.assert_called_with("spam")
예제 #4
0
 def test_should_only_return_py_suffix(self, walk):
     expected_result = ["spam/spam.py", "spam/eggs.py"]
     actual_result = set(discover_files("spam", ".py"))
     self.assertEquals(set(expected_result), actual_result)
     walk.assert_called_with("spam")
예제 #5
0
def discover_python_files(directory):
    return discover_files(directory, ".py")