Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd authored and agjohnson committed Aug 27, 2018
1 parent ff0139d commit fefdea4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions readthedocs/config/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,26 @@ def test_requirements_file_respects_configuration(tmpdir):
assert build.python.requirements == 'requirements.txt'


def test_requirements_file_is_null(tmpdir):
build = get_build_config(
{'requirements_file': None},
get_env_config(),
source_file=str(tmpdir.join('readthedocs.yml')),
)
build.validate()
assert build.requirements_file is None


def test_requirements_file_is_blank(tmpdir):
build = get_build_config(
{'requirements_file': ''},
get_env_config(),
source_file=str(tmpdir.join('readthedocs.yml')),
)
build.validate()
assert build.requirements_file is None


def test_build_validate_calls_all_subvalidators(tmpdir):
apply_fs(tmpdir, minimal_config)
build = BuildConfigV1(
Expand Down
18 changes: 18 additions & 0 deletions readthedocs/config/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ def test_parse_single_config():
assert config[0]['base'] == 'path'


def test_parse_null_value():
buf = StringIO(u'base: null')
config = parse(buf)
assert config[0]['base'] is None


def test_parse_empty_value():
buf = StringIO(u'base:')
config = parse(buf)
assert config[0]['base'] is None


def test_parse_empty_string_value():
buf = StringIO(u'base: ""')
config = parse(buf)
assert config[0]['base'] == ''


def test_parse_empty_list():
buf = StringIO(u'base: []')
config = parse(buf)
Expand Down

0 comments on commit fefdea4

Please sign in to comment.