Skip to content

Commit

Permalink
changed test to reflect new check names
Browse files Browse the repository at this point in the history
  • Loading branch information
jchopard committed Aug 11, 2017
1 parent d5acb15 commit f31f8ce
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions test/test_option/test_base/test_config.py
Expand Up @@ -16,20 +16,20 @@ def test_config_check_pkg_names():
'namespace_method': "pkg_util",
'owner': 'moi',
'url': None}))
assert 'pkgname' in check(cfg)
assert 'base.pkgname' in check(cfg)
cfg = Config(dict(base={'pkgname': 'toto',
'namespace': pkg,
'namespace_method': "pkg_util",
'owner': 'moi',
'url': None}))
assert 'namespace' in check(cfg)
assert 'base.namespace' in check(cfg)

cfg = Config(dict(base={'pkgname': 'toto',
'namespace': None,
'namespace_method': "toto",
'owner': 'moi',
'url': None}))
assert 'namespace_method' in check(cfg)
assert 'base.namespace_method' in check(cfg)


def test_require():
Expand Down
6 changes: 3 additions & 3 deletions test/test_option/test_doc/test_config.py
Expand Up @@ -11,18 +11,18 @@ def test_update_parameters():
def test_config_check_description_exists():
cfg = Config(dict(doc={'description': "mydescr", 'keywords': []}))
assert cfg['doc']['description'] == "mydescr"
assert 'description' not in check(cfg)
assert 'doc.description' not in check(cfg)


def test_config_check_description_valid():
cfg = Config(dict(doc={'description': "", 'keywords': []}))
assert 'description' in check(cfg)
assert 'doc.description' in check(cfg)


def test_config_check_keywords_exists():
cfg = Config(dict(doc={'description': "mydescr", 'keywords': []}))
assert len(cfg['doc']['keywords']) == 0
assert 'keywords' not in check(cfg)
assert 'doc.keywords' not in check(cfg)


def test_require():
Expand Down
2 changes: 1 addition & 1 deletion test/test_option/test_github/test_config.py
Expand Up @@ -10,7 +10,7 @@ def test_update_parameters():

def test_config_check_project_exists():
cfg = Config(dict(github={'owner': "", 'project': "", "url": ""}))
assert 'project' in check(cfg)
assert 'github.project' in check(cfg)


def test_require():
Expand Down
4 changes: 2 additions & 2 deletions test/test_option/test_license/test_config.py
Expand Up @@ -11,11 +11,11 @@ def test_update_parameters():
def test_config_check_license_name_exists():
cfg = Config(dict(license={'name': "", 'year': 2015,
'organization': "oa", 'project': "project"}))
assert 'name' in check(cfg)
assert 'license.name' in check(cfg)

cfg = Config(dict(license={'name': "tugudu", 'year': 2015,
'organization': "oa", 'project': "project"}))
assert 'name' in check(cfg)
assert 'license.name' in check(cfg)


def test_require():
Expand Down
4 changes: 2 additions & 2 deletions test/test_option/test_notebook/test_config.py
Expand Up @@ -25,10 +25,10 @@ def test_update_parameters():

def test_config_check_src_directory(tmp_dir):
cfg = Config(dict(notebook={'src_directory': "failed_nb"}))
assert 'src_directory' in check(cfg)
assert 'notebook.src_directory' in check(cfg)

cfg = Config(dict(notebook={'src_directory': tmp_dir}))
assert 'src_directory' not in check(cfg)
assert 'notebook.src_directory' not in check(cfg)


def test_require():
Expand Down
2 changes: 1 addition & 1 deletion test/test_option/test_pypi/test_config.py
Expand Up @@ -10,7 +10,7 @@ def test_update_parameters():

def test_config_check_classifiers_exists():
cfg = Config(dict(pypi={'classifiers': []}))
assert 'classifiers' in check(cfg)
assert 'pypi.classifiers' in check(cfg)


def test_require():
Expand Down
6 changes: 3 additions & 3 deletions test/test_option/test_pysetup/test_config.py
Expand Up @@ -10,12 +10,12 @@ def test_update_parameters():

def test_config_check_intended_version_exists():
cfg = Config(dict(pysetup={'intended_versions': [], 'require': []}))
assert 'intended_versions' in check(cfg)
assert 'require' not in check(cfg)
assert 'pysetup.intended_versions' in check(cfg)
assert 'pysetup.require' not in check(cfg)

cfg = Config(dict(pysetup={'intended_versions': ["27"],
'require': [{'pkg_mng': 'walou', 'name': 'numpy'}]}))
assert 'require' in check(cfg)
assert 'pysetup.require' in check(cfg)


def test_require():
Expand Down
2 changes: 1 addition & 1 deletion test/test_option/test_readthedocs/test_config.py
Expand Up @@ -10,7 +10,7 @@ def test_update_parameters():

def test_config_check_project_exists():
cfg = Config(dict(readthedocs={'project': ""}))
assert 'project' in check(cfg)
assert 'readthedocs.project' in check(cfg)


def test_require():
Expand Down
2 changes: 1 addition & 1 deletion test/test_option/test_sphinx/test_config.py
Expand Up @@ -11,7 +11,7 @@ def test_update_parameters():
def test_config_check_sphinx_theme():
for theme in (1, None,):
cfg = Config(dict(sphinx={'theme': theme}))
assert 'theme' in check(cfg)
assert 'sphinx.theme' in check(cfg)


def test_require():
Expand Down
2 changes: 1 addition & 1 deletion test/test_option/test_test/test_config.py
Expand Up @@ -11,7 +11,7 @@ def test_update_parameters():
def test_config_check_suite_names():
for name in ('walou', ' nose'):
cfg = Config(dict(test={'suite_name': name}))
assert 'suite_name' in check(cfg)
assert 'test.suite_name' in check(cfg)


def test_require():
Expand Down
20 changes: 10 additions & 10 deletions test/test_option/test_version/test_config.py
Expand Up @@ -10,19 +10,19 @@ def test_update_parameters():

def test_config_check_version_numbers_are_valid():
cfg = Config(dict(version={'major': "", 'minor': "", 'post': ""}))
assert 'major' in check(cfg)
assert 'minor' in check(cfg)
assert 'post' in check(cfg)
assert 'version.major' in check(cfg)
assert 'version.minor' in check(cfg)
assert 'version.post' in check(cfg)
cfg = Config(dict(version={'major': "a", 'minor': "a", 'post': "a"}))
assert 'major' in check(cfg)
assert 'minor' in check(cfg)
assert 'post' in check(cfg)
assert 'version.major' in check(cfg)
assert 'version.minor' in check(cfg)
assert 'version.post' in check(cfg)
cfg = Config(dict(version={'major': "1", 'minor': "1", 'post': "1"}))
assert 'major' in check(cfg)
assert 'minor' in check(cfg)
assert 'post' in check(cfg)
assert 'version.major' in check(cfg)
assert 'version.minor' in check(cfg)
assert 'version.post' in check(cfg)
cfg = Config(dict(version={'major': 1, 'minor': 0, 'post': "2.dev"}))
assert 'post' in check(cfg)
assert 'version.post' in check(cfg)


def test_require():
Expand Down

0 comments on commit f31f8ce

Please sign in to comment.