|
1 |
| -# -*- coding: utf-8 -*- |
2 | 1 | import os
|
3 | 2 | import re
|
4 | 3 | import textwrap
|
@@ -852,16 +851,6 @@ def test_conda_check_valid(self, tmpdir):
|
852 | 851 | build.validate()
|
853 | 852 | assert build.conda.environment == str(tmpdir.join('environment.yml'))
|
854 | 853 |
|
855 |
| - def test_conda_check_invalid(self, tmpdir): |
856 |
| - apply_fs(tmpdir, {'environment.yml': ''}) |
857 |
| - build = self.get_build_config( |
858 |
| - {'conda': {'environment': 'no_existing_environment.yml'}}, |
859 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
860 |
| - ) |
861 |
| - with raises(InvalidConfig) as excinfo: |
862 |
| - build.validate() |
863 |
| - assert excinfo.value.key == 'conda.environment' |
864 |
| - |
865 | 854 | @pytest.mark.parametrize('value', [3, [], 'invalid'])
|
866 | 855 | def test_conda_check_invalid_value(self, value):
|
867 | 856 | build = self.get_build_config({'conda': value})
|
@@ -1049,22 +1038,6 @@ def test_python_install_check_default(self, tmpdir):
|
1049 | 1038 | assert install[0].method == PIP
|
1050 | 1039 | assert install[0].extra_requirements == []
|
1051 | 1040 |
|
1052 |
| - def test_python_install_path_check_invalid(self, tmpdir): |
1053 |
| - build = self.get_build_config( |
1054 |
| - { |
1055 |
| - 'python': { |
1056 |
| - 'install': [{ |
1057 |
| - 'path': 'noexists', |
1058 |
| - 'method': 'pip', |
1059 |
| - }], |
1060 |
| - }, |
1061 |
| - }, |
1062 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
1063 |
| - ) |
1064 |
| - with raises(InvalidConfig) as excinfo: |
1065 |
| - build.validate() |
1066 |
| - assert excinfo.value.key == 'python.install.0.path' |
1067 |
| - |
1068 | 1041 | @pytest.mark.parametrize('value', ['invalid', 'apt'])
|
1069 | 1042 | def test_python_install_method_check_invalid(self, value, tmpdir):
|
1070 | 1043 | build = self.get_build_config(
|
@@ -1100,26 +1073,6 @@ def test_python_install_requirements_check_valid(self, tmpdir):
|
1100 | 1073 | assert isinstance(install[0], PythonInstallRequirements)
|
1101 | 1074 | assert install[0].requirements == str(tmpdir.join('requirements.txt'))
|
1102 | 1075 |
|
1103 |
| - def test_python_install_requirements_check_invalid(self, tmpdir): |
1104 |
| - apply_fs(tmpdir, {'requirements.txt': ''}) |
1105 |
| - requirements_file = 'invalid' |
1106 |
| - build = self.get_build_config( |
1107 |
| - { |
1108 |
| - 'python': { |
1109 |
| - 'install': [{ |
1110 |
| - 'path': '.', |
1111 |
| - 'requirements': requirements_file, |
1112 |
| - }], |
1113 |
| - }, |
1114 |
| - }, |
1115 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
1116 |
| - ) |
1117 |
| - with raises(InvalidConfig) as excinfo: |
1118 |
| - build.validate() |
1119 |
| - assert excinfo.value.key == 'python.install.0.requirements' |
1120 |
| - error_msg = 'path {} does not exist'.format(requirements_file) |
1121 |
| - assert error_msg in str(excinfo.value) |
1122 |
| - |
1123 | 1076 | def test_python_install_requirements_does_not_allow_null(self, tmpdir):
|
1124 | 1077 | build = self.get_build_config(
|
1125 | 1078 | {
|
@@ -1370,7 +1323,7 @@ def test_python_install_extra_requirements_allow_empty(self, tmpdir):
|
1370 | 1323 | {
|
1371 | 1324 | 'python': {
|
1372 | 1325 | 'install': [{
|
1373 |
| - 'path': '', |
| 1326 | + 'path': '.', |
1374 | 1327 | 'method': 'pip',
|
1375 | 1328 | 'extra_requirements': [],
|
1376 | 1329 | }],
|
@@ -1419,32 +1372,6 @@ def test_python_install_several_respects_order(self, tmpdir):
|
1419 | 1372 |
|
1420 | 1373 | assert install[2].requirements == str(tmpdir.join('three.txt'))
|
1421 | 1374 |
|
1422 |
| - def test_python_install_reports_correct_invalid_index(self, tmpdir): |
1423 |
| - apply_fs(tmpdir, { |
1424 |
| - 'one': {}, |
1425 |
| - 'two': {}, |
1426 |
| - }) |
1427 |
| - build = self.get_build_config( |
1428 |
| - { |
1429 |
| - 'python': { |
1430 |
| - 'install': [{ |
1431 |
| - 'path': 'one', |
1432 |
| - 'method': 'pip', |
1433 |
| - 'extra_requirements': [], |
1434 |
| - }, { |
1435 |
| - 'path': 'two', |
1436 |
| - 'method': 'setuptools', |
1437 |
| - }, { |
1438 |
| - 'requirements': 'three.txt', |
1439 |
| - }], |
1440 |
| - }, |
1441 |
| - }, |
1442 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
1443 |
| - ) |
1444 |
| - with raises(InvalidConfig) as excinfo: |
1445 |
| - build.validate() |
1446 |
| - assert excinfo.value.key == 'python.install.2.requirements' |
1447 |
| - |
1448 | 1375 | @pytest.mark.parametrize('value', [True, False])
|
1449 | 1376 | def test_python_system_packages_check_valid(self, value):
|
1450 | 1377 | build = self.get_build_config({
|
@@ -1557,16 +1484,6 @@ def test_sphinx_configuration_check_valid(self, tmpdir):
|
1557 | 1484 | build.validate()
|
1558 | 1485 | assert build.sphinx.configuration == str(tmpdir.join('conf.py'))
|
1559 | 1486 |
|
1560 |
| - def test_sphinx_configuration_check_invalid(self, tmpdir): |
1561 |
| - apply_fs(tmpdir, {'conf.py': ''}) |
1562 |
| - build = self.get_build_config( |
1563 |
| - {'sphinx': {'configuration': 'invalid.py'}}, |
1564 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
1565 |
| - ) |
1566 |
| - with raises(InvalidConfig) as excinfo: |
1567 |
| - build.validate() |
1568 |
| - assert excinfo.value.key == 'sphinx.configuration' |
1569 |
| - |
1570 | 1487 | def test_sphinx_cant_be_used_with_mkdocs(self, tmpdir):
|
1571 | 1488 | apply_fs(tmpdir, {'conf.py': ''})
|
1572 | 1489 | build = self.get_build_config(
|
@@ -1669,16 +1586,6 @@ def test_mkdocs_configuration_check_valid(self, tmpdir):
|
1669 | 1586 | assert build.doctype == 'mkdocs'
|
1670 | 1587 | assert build.sphinx is None
|
1671 | 1588 |
|
1672 |
| - def test_mkdocs_configuration_check_invalid(self, tmpdir): |
1673 |
| - apply_fs(tmpdir, {'mkdocs.yml': ''}) |
1674 |
| - build = self.get_build_config( |
1675 |
| - {'mkdocs': {'configuration': 'invalid.yml'}}, |
1676 |
| - source_file=str(tmpdir.join('readthedocs.yml')), |
1677 |
| - ) |
1678 |
| - with raises(InvalidConfig) as excinfo: |
1679 |
| - build.validate() |
1680 |
| - assert excinfo.value.key == 'mkdocs.configuration' |
1681 |
| - |
1682 | 1589 | def test_mkdocs_configuration_allow_null(self):
|
1683 | 1590 | build = self.get_build_config(
|
1684 | 1591 | {'mkdocs': {'configuration': None}},
|
|
0 commit comments