def test_to_yaml_with_defaults(self): config = SanicRestConfiguration("sanic") data = {} config.to_yaml(data, True) self.assertEquals(data['workers'], 4) self.assertEquals(data['bot'], 'bot') self.assertEquals(data['license_keys'], "./config/license.keys") self.assertEquals(data['bot_selector'], "programy.clients.client.DefaultBotSelector") self.assertEquals(data['renderer'], "programy.clients.render.text.TextRenderer")
def test_to_yaml_with_no_defaults(self): config = SanicRestConfiguration("sanic") data = {} config.to_yaml(data, False) self.assertEqual(data['workers'], 4) self.assertEqual(data['host'], "0.0.0.0") self.assertEqual(data['port'], 80) self.assertEqual(data['debug'], False) self.assertEqual(data['api'], '/api/rest/v1.0/ask') self.assertEqual(data['use_api_keys'], False) self.assertEqual(data['api_key_file'], None) self.assertEqual(data['ssl_cert_file'], None) self.assertEqual(data['ssl_key_file'], None) self.assertEqual(data['authorization'], None)