Example #1
0
def test_empty_json(request):
    os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_empty.json')
    with pytest.raises(LookupError):
        Config().config
Example #2
0
def test_valid_json(request):
    os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_good.json')
    config = Config().config
    assert type(config) is dict, "Should be dict"
Example #3
0
def test_invalid_json(request):
    os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_bad.json')
    with pytest.raises(JSONDecodeError):
        Config().config
Example #4
0
def test_empty_json(request):
    os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_empty.json')
    with pytest.raises(SystemExit) as e:
        Config().config
        assert e.type == SystemExit, "Should exit when file isn't valid"