示例#1
0
 def test_path_exists(self):
     cfg = json.dumps({"token": "foo", "team": "bar"})
     config_file = StringIO(cfg.encode('utf8').decode())
     path = mock.MagicMock()
     path.open.return_value.__enter__.return_value = config_file
     config = idonethis.read_config(path)
     self.assertEqual({'token': 'foo', 'team': 'bar'}, config)
示例#2
0
 def test_reading_config_fails(self):
     config = idonethis.read_config(None)
     self.assertEqual(config, {})