예제 #1
0
    def test_all_testfiles_one_valid_file(self, os_listdir, os_exists):
        os_exists.return_value = True
        os_listdir.return_value = ["foo", "bar.md"]

        expected = ["bar.md"]
        result = list(loading.all_testfiles('/root'))
        self.assertEquals(result, expected)
예제 #2
0
    def test_all_testfiles_dir_does_not_exist(self, os_exists):
        os_exists.return_value = False

        expected = []
        result = loading.all_testfiles('/root')

        self.assertEquals(result, expected)
예제 #3
0
    def test_all_testfiles_invalid_files(self, os_listdir, os_exists):
        os_exists.return_value = True
        os_listdir.return_value = ["foo"]

        expected = []
        result = list(loading.all_testfiles('/root'))

        os_listdir.assert_called_once_with
        self.assertEquals(result, expected)