Esempio n. 1
0
def test_reader_value_error_noinput():
    with pytest.raises(ValueError):
        reader.reader()
Esempio n. 2
0
def test_reader_exception_notgithuburl():
    with pytest.raises(Exception):
        reader.reader("Imnaeaurl")
Esempio n. 3
0
def test_reader_exception_typourl():
    with pytest.raises(Exception):
        reader.reader("https://github.com/ZedThree/cff-reader-python-imatypo/")
Esempio n. 4
0
def test_reader_from_url():
    testurl = "https://github.com/ZedThree/cff-reader-python/"
    assert isinstance(reader.reader(from_url=testurl), dict)
Esempio n. 5
0
def test_reader_from_file(valid_cff_filename):
    with open(valid_cff_filename, 'r') as f:
        assert isinstance(reader.reader(from_file=f), dict)
Esempio n. 6
0
def test_reader_from_filename(valid_cff_filename):
    assert isinstance(reader.reader(from_filename=valid_cff_filename), dict)
Esempio n. 7
0
def test_reader_value_error_filename_insteadoffile(valid_cff_filename):
    with pytest.raises(ValueError):
        reader.reader(from_file=valid_cff_filename)
Esempio n. 8
0
def test_reader_value_error_invalid():
    with pytest.raises(ValueError):
        reader.reader(from_filename="tests/invalid_yaml.cff")