Пример #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()
Пример #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()
Пример #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)
Пример #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)