def test_read_config_exception(self, monkeypatch): monkeypatch.setattr('focli.focli.CONFIG_PATH', '/does/not/exist/for/sure') assert focli.read_config() == dict()
def test_read_config(self, monkeypatch): fcontent = '{"123":"abc"}' with mock.patch.object(builtins, 'open', mock.mock_open(read_data=fcontent)): assert focli.read_config() == json.loads(fcontent)