Exemple #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()
Exemple #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()
Exemple #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)
Exemple #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)