def test_empty_json(request): os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_empty.json') with pytest.raises(LookupError): Config().config
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"
def test_invalid_json(request): os.environ['FCREPLAY_CONFIG'] = datadir(request, 'config_bad.json') with pytest.raises(JSONDecodeError): Config().config
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"