Skip to content

Commit 71f3770

Browse files
committed
Fix imports in tests/mocks
1 parent b286263 commit 71f3770

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

readthedocs/rtd_tests/mocks/mock_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def project(self, x):
8181
def mock_api(repo):
8282
api_mock = MockApi(repo)
8383
with (
84-
mock.patch('restapi.client.api', api_mock) and
85-
mock.patch('api.client.api', api_mock) and
86-
mock.patch('projects.tasks.api_v2', api_mock) and
87-
mock.patch('projects.tasks.api_v1', api_mock)):
84+
mock.patch('readthedocs.restapi.client.api', api_mock) and
85+
mock.patch('readthedocs.api.client.api', api_mock) and
86+
mock.patch('readthedocs.projects.tasks.api_v2', api_mock) and
87+
mock.patch('readthedocs.projects.tasks.api_v1', api_mock)):
8888
yield api_mock

readthedocs/rtd_tests/tests/test_builds.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BuildTests(TestCase):
3434

3535
@mock.patch('slumber.Resource')
3636
@mock.patch('os.chdir')
37-
@mock.patch('projects.models.Project.api_versions')
37+
@mock.patch('readthedocs.projects.models.Project.api_versions')
3838
@mock.patch('subprocess.Popen')
3939
def test_build(self, mock_Popen, mock_api_versions, mock_chdir, mock_apiv2_downloads):
4040

@@ -95,9 +95,9 @@ def test_builder_no_comments(self):
9595
@mock.patch('slumber.Resource')
9696
@mock.patch('os.chdir')
9797
@mock.patch('subprocess.Popen')
98-
@mock.patch('doc_builder.backends.sphinx.HtmlBuilder.build')
99-
@mock.patch('doc_builder.backends.sphinx.PdfBuilder.build')
100-
@mock.patch('doc_builder.backends.sphinx.EpubBuilder.build')
98+
@mock.patch('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build')
99+
@mock.patch('readthedocs.doc_builder.backends.sphinx.PdfBuilder.build')
100+
@mock.patch('readthedocs.doc_builder.backends.sphinx.EpubBuilder.build')
101101
def test_build_respects_pdf_flag(self,
102102
EpubBuilder_build,
103103
PdfBuilder_build,
@@ -139,9 +139,9 @@ def test_build_respects_pdf_flag(self,
139139
@mock.patch('slumber.Resource')
140140
@mock.patch('os.chdir')
141141
@mock.patch('subprocess.Popen')
142-
@mock.patch('doc_builder.backends.sphinx.HtmlBuilder.build')
143-
@mock.patch('doc_builder.backends.sphinx.PdfBuilder.build')
144-
@mock.patch('doc_builder.backends.sphinx.EpubBuilder.build')
142+
@mock.patch('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build')
143+
@mock.patch('readthedocs.doc_builder.backends.sphinx.PdfBuilder.build')
144+
@mock.patch('readthedocs.doc_builder.backends.sphinx.EpubBuilder.build')
145145
def test_build_respects_epub_flag(self,
146146
EpubBuilder_build,
147147
PdfBuilder_build,

readthedocs/rtd_tests/tests/test_core_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _input(_, files=None):
4040
assert cmd._get_input() == '{"test": "foobar"}'
4141

4242
@patch.object(run_docker.Command, '_get_input', _get_input)
43-
@patch('projects.tasks.docker_build', _docker_build)
43+
.patch('readthedocs.projects.tasks.docker_build', _docker_build)
4444
@patch('sys.stdout', new_callable=StringIO)
4545
def test_good_input(self, mock_output):
4646
'''Test docker build command'''
@@ -52,7 +52,7 @@ def test_good_input(self, mock_output):
5252
'{"html": [0, "DOCKER PASS", ""]}\n'
5353
)
5454

55-
@patch('projects.tasks.docker_build', _docker_build)
55+
.patch('readthedocs.projects.tasks.docker_build', _docker_build)
5656
def test_bad_input(self):
5757
'''Test docker build command'''
5858
with patch.object(run_docker.Command, '_get_input') as mock_input:

readthedocs/rtd_tests/tests/test_project_symlinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def wrapper(self):
1818
def _collect_commands(cmd):
1919
self.commands.append(cmd)
2020

21-
with patch('projects.symlinks.run_on_app_servers', _collect_commands):
21+
with.patch('readthedocs.projects.symlinks.run_on_app_servers', _collect_commands):
2222
with patch('readthedocs.projects.symlinks.run_on_app_servers', _collect_commands):
2323
return fn(self)
2424
return wrapper

readthedocs/rtd_tests/tests/test_urls.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,47 @@ class SubdomainUrlTests(TestCase):
99

1010
def test_sub_index(self):
1111
url = reverse(core.views.redirect_project_slug,
12-
urlconf='core.subdomain_urls')
12+
urlconf='readthedocs.core.subdomain_urls')
1313
self.assertEqual(url, '/')
1414

1515
def test_sub_lang_version(self):
16-
url = reverse('docs_detail', urlconf='core.subdomain_urls',
16+
url = reverse('docs_detail', urlconf='readthedocs.core.subdomain_urls',
1717
kwargs={'lang_slug': 'en', 'version_slug': LATEST})
1818
self.assertEqual(url, '/en/latest/')
1919

2020
def test_sub_lang_version_filename(self):
21-
url = reverse('docs_detail', urlconf='core.subdomain_urls',
21+
url = reverse('docs_detail', urlconf='readthedocs.core.subdomain_urls',
2222
args=['en', 'latest', 'index.html'])
2323
self.assertEqual(url, '/en/latest/index.html')
2424

2525
def test_sub_project_full_path(self):
2626
url = reverse('subproject_docs_detail',
27-
urlconf='core.subdomain_urls',
27+
urlconf='readthedocs.core.subdomain_urls',
2828
kwargs={'project_slug':'pyramid', 'lang_slug': 'en',
2929
'version_slug': LATEST, 'filename': 'index.html'})
3030
self.assertEqual(url, '/projects/pyramid/en/latest/index.html')
3131

3232
def test_sub_project_slug_only(self):
3333
url = reverse('subproject_docs_detail',
34-
urlconf='core.subdomain_urls',
34+
urlconf='readthedocs.core.subdomain_urls',
3535
kwargs={'project_slug': 'pyramid'})
3636
self.assertEqual(url, '/projects/pyramid')
3737

3838
def test_sub_page(self):
3939
url = reverse('docs_detail',
40-
urlconf='core.subdomain_urls',
40+
urlconf='readthedocs.core.subdomain_urls',
4141
kwargs={'filename': 'install.html'})
4242
self.assertEqual(url, '/page/install.html')
4343

4444
def test_sub_version(self):
4545
url = reverse('version_subdomain_handler',
46-
urlconf='core.subdomain_urls',
46+
urlconf='readthedocs.core.subdomain_urls',
4747
kwargs={'version_slug': '1.4.1'})
4848
self.assertEqual(url, '/1.4.1/')
4949

5050
def test_sub_lang(self):
5151
url = reverse('lang_subdomain_handler',
52-
urlconf='core.subdomain_urls',
52+
urlconf='readthedocs.core.subdomain_urls',
5353
kwargs={'lang_slug': 'en'})
5454
self.assertEqual(url, '/en/')
5555

0 commit comments

Comments
 (0)