Example #1
0
    def test_read_config_exception(self, monkeypatch):
        monkeypatch.setattr('focli.focli.CONFIG_PATH',
                            '/does/not/exist/for/sure')

        assert focli.read_config() == dict()
Example #2
0
    def test_read_config_exception(self, monkeypatch):
        monkeypatch.setattr('focli.focli.CONFIG_PATH',
                            '/does/not/exist/for/sure')

        assert focli.read_config() == dict()
Example #3
0
 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)
Example #4
0
 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)