def it_fails_if_base_does_not_exist(tmpdir): apply_fs(tmpdir, minimal_config) build = BuildConfig({}, {'base': 'docs'}, source_file=str(tmpdir.join('readthedocs.yml')), source_position=0) with raises(InvalidConfig) as excinfo: build.validate_base() assert excinfo.value.key == 'base' assert excinfo.value.code == INVALID_PATH
def it_validates_to_abspath(tmpdir): apply_fs(tmpdir, {'configs': minimal_config, 'docs': {}}) with tmpdir.as_cwd(): source_file = str(tmpdir.join('configs', 'readthedocs.yml')) build = BuildConfig({}, {'base': '../docs'}, source_file=source_file, source_position=0) build.validate_base() assert build['base'] == str(tmpdir.join('docs'))
def it_fails_if_base_is_not_a_string(tmpdir): apply_fs(tmpdir, minimal_config) with tmpdir.as_cwd(): build = BuildConfig({}, {'base': 1}, source_file=str( tmpdir.join('readthedocs.yml')), source_position=0) with raises(InvalidConfig) as excinfo: build.validate_base() assert excinfo.value.key == 'base' assert excinfo.value.code == INVALID_STRING