Exemple #1
0
    def test_given_import_error_then_returns_empty_list(
            self, resource_listdir):
        resource_listdir.side_effect = ImportError

        result = server._list_resources()

        assert_that(result, contains())
Exemple #2
0
    def test_given_python_files_then_returns_empty_list(
            self, resource_listdir):
        resource_listdir.return_value = ['python_file.py', 'python_file.pyc']

        result = server._list_resources()

        assert_that(result, contains())
    def test_given_file_then_returns_empty_list(self, resource_listdir, resource_isdir):
        resource_listdir.return_value = ['file']
        resource_isdir.return_value = False

        result = server._list_resources()

        assert_that(result, contains())
    def test_given_directory_then_returns_list_with_directory_name(self, resource_listdir, resource_isdir):
        resource_listdir.return_value = ['directory']
        resource_isdir.return_value = True

        result = server._list_resources()

        assert_that(result, contains('directory'))
Exemple #5
0
    def test_given_file_then_returns_empty_list(self, resource_listdir,
                                                resource_isdir):
        resource_listdir.return_value = ['file']
        resource_isdir.return_value = False

        result = server._list_resources()

        assert_that(result, contains())
Exemple #6
0
    def test_given_directory_then_returns_list_with_directory_name(
            self, resource_listdir, resource_isdir):
        resource_listdir.return_value = ['directory']
        resource_isdir.return_value = True

        result = server._list_resources()

        assert_that(result, contains('directory'))
    def test_given_import_error_then_returns_empty_list(self, resource_listdir):
        resource_listdir.side_effect = ImportError

        result = server._list_resources()

        assert_that(result, contains())
    def test_given_python_files_then_returns_empty_list(self, resource_listdir):
        resource_listdir.return_value = ['python_file.py', 'python_file.pyc']

        result = server._list_resources()

        assert_that(result, contains())