Beispiel #1
0
 def test_get_config_list_setting(self):
     request = config_messages.GetConfigRequest(
         name='test_config_list',
         config_type=config_messages.ConfigType.LIST)
     response = self.service.get_config(request)
     self.assertEqual(self.existing_list_config_in_datastore.list_value,
                      response.list_value)
Beispiel #2
0
 def test_get_config_bool_setting(self):
     request = config_messages.GetConfigRequest(
         name='test_config_bool',
         config_type=config_messages.ConfigType.BOOLEAN)
     response = self.service.get_config(request)
     self.assertEqual(self.existing_bool_config_in_datastore.bool_value,
                      response.boolean_value)
Beispiel #3
0
 def test_get_config_invalid_setting(self):
   request = config_messages.GetConfigRequest(
       name='Not Valid',
       config_type=config_messages.ConfigType.STRING)
   self.assertRaisesRegexp(
       config_api.endpoints.BadRequestException,
       'No such name',
       self.service.get_config,
       request)
Beispiel #4
0
 def test_get_config_missing_fields(self):
   request = config_messages.GetConfigRequest()
   with self.assertRaises(config_api.endpoints.BadRequestException):
     self.service.get_config(request)
 def testGetConfigRequest(self):
   config = config_messages.GetConfigRequest(
       name='test', config_type=config_messages.ConfigType(1))
   self.assertEqual(config.name, 'test')
   self.assertEqual(config.config_type.name, 'STRING')