def test_refuses_readme(): with local.cwd(local.cwd / context.module_name): for ext in ['.py', '.doc', '.mp3']: path = 'README{0}'.format(ext) open(path, 'w') with pytest.raises(exceptions.ProbeException): probe.has_readme() os.remove(path)
def test_refuses_readme(): with CliRunner().isolated_filesystem(): for ext in ['.py', '.doc', '.mp3']: path = 'README{0}'.format(ext) open(path, 'w') with pytest.raises(exceptions.ProbeException): probe.has_readme() os.remove(path)
def test_accepts_readme(): with local.cwd(local.cwd / context.module_name): for ext in probe.README_EXTENSIONS: path = 'README{0}'.format(ext) open(path, 'w') assert probe.has_readme() os.remove(path)
def test_fails_for_missing_readme(): with local.cwd(local.cwd / context.module_name): for i in glob.glob('README*'): os.remove(i) with pytest.raises(exceptions.ProbeException): probe.has_readme()
def test_fails_for_missing_readme(python_module): with CliRunner().isolated_filesystem(): with pytest.raises(exceptions.ProbeException): probe.has_readme()
def test_accepts_readme(python_module): for ext in probe.README_EXTENSIONS: path = 'README{0}'.format(ext) open(path, 'w') assert probe.has_readme() os.remove(path)