Merge pull request #3740 from italia/mockconffile

tests: mock test_conf_file_not_found filesystem access
agj/remove-symlink-serving
Manuel Kaufmann 2018-04-03 20:53:46 -05:00 committed by GitHub
commit 786edd46d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -315,7 +315,11 @@ class TestProject(TestCase):
'/home/docs/rtfd/code/readthedocs.org/user_builds/pip/checkouts/latest/docs/conf.py',
)
def test_conf_file_not_found(self):
@patch('readthedocs.projects.models.Project.find')
@patch('readthedocs.projects.models.Project.full_find')
def test_conf_file_not_found(self, find_method, full_find_method):
find_method.return_value = []
full_find_method.return_value = []
with self.assertRaisesMessage(
ProjectConfigurationError,
ProjectConfigurationError.NOT_FOUND) as cm: