def test___init__(self, pro___init__, icm___init__, cacrc___init__): """ Assert that __init__ works correctly. """ context = mock.MagicMock() cprc = cudl.CreatePythonRepositoryCommand(context) cacrc___init__.assert_called_once_with(cprc, context) icm___init__.assert_called_once_with(cprc, **cudl.IMPORTER_CONFIGURATION_FLAGS) pro___init__.assert_called_once_with(cprc)
def test_describe_distributors(self): command = cudl.CreatePythonRepositoryCommand(Mock()) user_input = {} result = command._describe_distributors(user_input) target_result = { 'distributor_id': constants.CLI_DISTRIBUTOR_ID, 'distributor_type_id': constants.DISTRIBUTOR_TYPE_ID, 'distributor_config': {}, 'auto_publish': True } compare_dict(result[0], target_result)
def test_describe_importers(self): command = cudl.CreatePythonRepositoryCommand(Mock()) user_input = {} result = command._parse_importer_config(user_input) target_result = {} compare_dict(result, target_result)
def test_describe_distributors_override_auto_publish(self): command = cudl.CreatePythonRepositoryCommand(Mock()) user_input = {'auto-publish': False} result = command._describe_distributors(user_input) self.assertEquals(result[0]["auto_publish"], False)