예제 #1
0
 def test_get_model_location_with_nonmatching_prefix_and_name(self):
     model_location = get_model_location(
         self.session,
         self._create_service_definition(self.non_matching_prefix,
                                         self.default_api_version))
     self.assertEqual(
         os.path.join(self.data_loader.CUSTOMER_DATA_PATH,
                      self.non_matching_service, self.default_api_version,
                      'service-2.json'), model_location)
예제 #2
0
 def test_get_model_location_of_nonexistent_service(self):
     model_location = get_model_location(
         self.session,
         self._create_service_definition('nonexistent',
                                         self.default_api_version))
     self.assertEqual(
         os.path.join(self.data_loader.CUSTOMER_DATA_PATH, 'nonexistent',
                      self.default_api_version, 'service-2.json'),
         model_location)
예제 #3
0
 def test_get_model_location_with_missing_version(self):
     service_definition = self._create_service_definition(
         'existent', self.default_api_version)
     service_definition.pop('version')
     model_location = get_model_location(self.session, service_definition)
     self.assertEqual(
         os.path.join(self.data_loader.CUSTOMER_DATA_PATH, 'existent',
                      self.default_api_version, 'service-2.json'),
         model_location)
예제 #4
0
 def test_get_model_location_for_matching_prefix_and_name(self):
     model_location = get_model_location(
         self.session, self._create_service_definition(
             self.matching_service, self.default_api_version))
     self.assertEqual(
         os.path.join(
             self.data_loader.CUSTOMER_DATA_PATH,
             self.matching_service, self.default_api_version,
             'service-2.json'), model_location)
예제 #5
0
 def test_get_model_location_when_service_name_provided(self):
     model_location = get_model_location(
         self.session, self._create_service_definition(
             'nonexistent', self.default_api_version), 'override')
     self.assertEqual(
         os.path.join(
             self.data_loader.CUSTOMER_DATA_PATH,
             'override', self.default_api_version,
             'service-2.json'), model_location)
예제 #6
0
 def test_get_model_location_of_nonexistent_service(self):
     model_location = get_model_location(
         self.session, self._create_service_definition(
             'nonexistent', self.default_api_version))
     self.assertEqual(
         os.path.join(
             self.data_loader.CUSTOMER_DATA_PATH,
             'nonexistent', self.default_api_version,
             'service-2.json'), model_location)
예제 #7
0
 def test_get_model_location_when_service_name_provided(self):
     model_location = get_model_location(
         self.session,
         self._create_service_definition('nonexistent',
                                         self.default_api_version),
         'override')
     self.assertEqual(
         os.path.join(self.data_loader.CUSTOMER_DATA_PATH, 'override',
                      self.default_api_version, 'service-2.json'),
         model_location)
예제 #8
0
 def test_get_model_location_with_missing_version(self):
     service_definition = self._create_service_definition(
         'existent', self.default_api_version)
     service_definition.pop('version')
     model_location = get_model_location(self.session, service_definition)
     self.assertEqual(
         os.path.join(
             self.data_loader.CUSTOMER_DATA_PATH,
             'existent', self.default_api_version,
             'service-2.json'), model_location)