@patch('argparse.ArgumentParser')
def test_retrieve_artifact_has_correct_options(self, parser_class_mock):
    parser_mock = Mock()
    parser_class_mock.return_value = parser_mock
    parser_mock.add_subparsers.return_value = self.level_1_subparsers_mock
    self.level_1_subparsers_mock.add_parser.return_value = self.level_2_parser_mock
    self.level_2_parser_mock.add_subparsers.return_value = self.level_2_subparsers_mock
    self.level_2_subparsers_mock.add_parser.return_value = self.level_3_parser_mock
    CommandLineInterface([])
    parser_class_mock.assert_called_with(prog='foundations')
    version_call = call('--version', action='store_true', help='Displays the current Foundations version')
    debug_call = call('--debug', action='store_true', help='Sets debug mode for the CLI')
    parser_mock.add_argument.assert_has_calls([version_call, debug_call])
    retrieve_call = call('get', help='Get file types from execution environments')
    self.level_1_subparsers_mock.add_parser.assert_has_calls([retrieve_call])
    retrieve_argument_call = call('job', help='Specify job to retrieve artifacts from')
    job_id_call = call('job_id', type=str, help='Specify job uuid of already deployed job')
    env_call = call('scheduler_config', type=str, help='Environment to get from')
    save_directory_call = call('--save_dir', type=str, default=None, help='Specify local directory path for artifacts to save to. Defaults to directory within current working directory')
    source_directory_call = call('--source_dir', type=str, default='', help='Specify relative directory path to download artifacts from. Default will download all artifacts from job')
    self.level_2_subparsers_mock.add_parser.assert_has_calls([retrieve_argument_call])
    self.level_3_parser_mock.add_argument.assert_has_calls([job_id_call, env_call, save_directory_call, source_directory_call], any_order=True)
@patch('argparse.ArgumentParser')
def test_retrieve_artifact_has_correct_options(self, parser_class_mock):
    parser_mock = Mock()
    parser_class_mock.return_value = parser_mock
    parser_mock.add_subparsers.return_value = self.level_1_subparsers_mock
    self.level_1_subparsers_mock.add_parser.return_value = self.level_2_parser_mock
    self.level_2_parser_mock.add_subparsers.return_value = self.level_2_subparsers_mock
    self.level_2_subparsers_mock.add_parser.return_value = self.level_3_parser_mock
    CommandLineInterface([])
    parser_class_mock.assert_called_with(prog='foundations')
    version_call = call('--version', action='store_true', help='Displays the current Foundations version')
    debug_call = call('--debug', action='store_true', help='Sets debug mode for the CLI')
    parser_mock.add_argument.assert_has_calls([version_call, debug_call])
    retrieve_call = call('get', help='Get file types from execution environments')
    self.level_1_subparsers_mock.add_parser.assert_has_calls([retrieve_call])
    retrieve_argument_call = call('job', help='Specify job to retrieve artifacts from')
    job_id_call = call('job_id', type=str, help='Specify job uuid of already deployed job')
    env_call = call('scheduler_config', type=str, help='Environment to get from')
    save_directory_call = call('--save_dir', type=str, default=None, help='Specify local directory path for artifacts to save to. Defaults to directory within current working directory')
    source_directory_call = call('--source_dir', type=str, default=, help='Specify relative directory path to download artifacts from. Default will download all artifacts from job')
    self.level_2_subparsers_mock.add_parser.assert_has_calls([retrieve_argument_call])
    self.level_3_parser_mock.add_argument.assert_has_calls([job_id_call, env_call, save_directory_call, source_directory_call], any_order=True)