Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 5
0
def discover_python_files(directory):
    return discover_files(directory, ".py")