示例#1
0
def test_zoidberg_create_object_output_raises_value_error_if_not_csv_or_json():
    with pytest.raises(ValueError):
        zoidberg_main.Zoidberg(country='es',
                               doctor="xxx",
                               area="xxx",
                               illness="xxx",
                               output="xml")
示例#2
0
def test_zoidberg_create_object_output_json():
    z = zoidberg_main.Zoidberg(country='es',
                               doctor="xxx",
                               area="xxx",
                               illness="xxx",
                               output="json")
    assert z.output == 'json'
示例#3
0
def test_zoidberg_create_object_area_raises_value_error_if_not_str():
    with pytest.raises(ValueError):
        zoidberg_main.Zoidberg(country='es',
                               doctor="xxx",
                               area=1,
                               illness="xxx")
示例#4
0
def test_zoidberg_create_object_country_is_defined():
    z = zoidberg_main.Zoidberg(country='es',
                               doctor="xxx",
                               area="xxx",
                               illness="xxx")
    assert z.country == 'es'
示例#5
0
def test_zoidberg_create_object_country_raises_value_error_if_not_str():
    with pytest.raises(ValueError):
        zoidberg_main.Zoidberg(country=12)
示例#6
0
def test_zoidberg_create_object_country_not_iso_alpha_2():
    with pytest.raises(ValueError):
        zoidberg_main.Zoidberg(country='USA')
示例#7
0
def test_zoidberg_create_object_output_default_csv():
    z = zoidberg_main.Zoidberg(country='es',
                               doctor="xxx",
                               area="xxx",
                               illness="xxx")
    assert z.output == 'csv'