예제 #1
0
파일: focli_test.py 프로젝트: joohoi/focli
    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
파일: focli_test.py 프로젝트: joohoi/focli
    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
파일: focli_test.py 프로젝트: joohoi/focli
 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
파일: focli_test.py 프로젝트: joohoi/focli
 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)