def test_get_config_list_setting(self): request = config_message.GetConfigRequest( name='test_config_list', config_type=config_message.ConfigType.LIST) response = self.service.get_config(request) self.assertEqual(self.existing_list_config_in_datastore.list_value, response.list_value)
def test_get_config_bool_setting(self): request = config_message.GetConfigRequest( name='test_config_bool', config_type=config_message.ConfigType.BOOLEAN) response = self.service.get_config(request) self.assertEqual(self.existing_bool_config_in_datastore.bool_value, response.boolean_value)
def test_get_config_missing_fields(self): request = config_message.GetConfigRequest() with self.assertRaises(config_api.endpoints.BadRequestException): self.service.get_config(request)
def test_get_config_invalid_setting(self): request = config_message.GetConfigRequest( name='Not Valid', config_type=config_message.ConfigType.STRING) self.assertRaisesRegexp(config_api.endpoints.BadRequestException, 'No such name', self.service.get_config, request)