Пример #1
0
def test_json_not_found():

    with pytest.raises(Exception):
        JSONFileDecoder(os.path.join(CURRENT_DIR, 'not_found.json'))
Пример #2
0
def test_json_bad_format():

    decoder = JSONFileDecoder(os.path.join(CURRENT_DIR, 'bad_format.json'))
    with pytest.raises(Exception):
        decoder.get_employees()
def test_json_correct():
    '''Test the decoding when a correct file is given'''

    decoder = JSONFileDecoder(os.path.join(CURRENT_DIR, 'correct.json'))
    assert len(decoder.get_employees()) == 3
Пример #4
0
def test_json_correct():
    '''Test the decoding when a correct file is given'''

    decoder = JSONFileDecoder(os.path.join(CURRENT_DIR, 'correct.json'))
    assert len(decoder.get_employees()) == 3
def test_json_bad_format():

    decoder = JSONFileDecoder(os.path.join(CURRENT_DIR, 'bad_format.json'))
    with pytest.raises(Exception):
        decoder.get_employees()