Example #1
0
 def test_describe_distributors_override_auto_publish(self):
     command = cudl.CreateDockerRepositoryCommand(Mock())
     user_input = {
         'auto-publish': False
     }
     result = command._describe_distributors(user_input)
     self.assertEquals(result[0]["auto_publish"], False)
Example #2
0
 def test_parse_importer_config(self):
     command = cudl.CreateDockerRepositoryCommand(Mock())
     user_input = {
         cudl.OPT_UPSTREAM_NAME.keyword: 'pulp/crane',
     }
     result = command._parse_importer_config(user_input)
     self.assertEqual(result[constants.CONFIG_KEY_UPSTREAM_NAME],
                      'pulp/crane')
Example #3
0
 def test_parse_importer_config_enable_v2_false(self):
     command = cudl.CreateDockerRepositoryCommand(Mock())
     user_input = {
         cudl.OPT_UPSTREAM_NAME.keyword: 'pulp/crane',
         cudl.OPT_ENABLE_V2.keyword: False,
     }
     result = command._parse_importer_config(user_input)
     self.assertEqual(result[constants.CONFIG_KEY_ENABLE_V2], False)
Example #4
0
 def test_describe_distributors(self):
     command = cudl.CreateDockerRepositoryCommand(Mock())
     user_input = {'redirect-url': 'foo',
                   'protected': False,
                   'repo-registry-id': 'bar'}
     result = command._describe_distributors(user_input)
     target_result = {
         'distributor_type_id': constants.DISTRIBUTOR_WEB_TYPE_ID,
         'distributor_config': {
             'redirect-url': 'foo', 'repo-registry-id': 'bar', 'protected': False},
         'auto_publish': True,
         'distributor_id': constants.CLI_WEB_DISTRIBUTOR_ID
     }
     compare_dict(result[0], target_result)