def test_get_args_default(self): args = get_args([JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY]) self.assertEqual(args, Namespace( all=False, artifact_file_ext=None, build_number=1277, jenkins_job=JOB_NAME, latest=False, password=None, s3_bucket=BUCKET, s3_directory=DIRECTORY, unique_id=None, user=None, no_prefixes=False))
def test_get_args_artifact_file_ext(self): args = get_args([ JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY, '--artifact-file-ext', '.svg', '.json', '--unique-id', '1234' ]) self.assertEqual(args.artifact_file_ext, ['.svg', '.json']) self.assertEqual(args.unique_id, '1234')
def test_get_args_latest(self): args = get_args([JOB_NAME, 'latest', BUCKET, DIRECTORY]) self.assertEqual(JOB_NAME, args.jenkins_job) self.assertIsNone(args.build_number) self.assertEqual(BUCKET, args.s3_bucket) self.assertEqual(DIRECTORY, args.s3_directory) self.assertFalse(args.all) self.assertTrue(args.latest) self.assertIsNone(args.user) self.assertIsNone(args.password)
def test_get_args_with_credentials(self): args = get_args(['--user', 'me', '--password', 'passwd', JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY]) self.assertEqual(JOB_NAME, args.jenkins_job) self.assertEqual(BUILD_NUM, args.build_number) self.assertEqual(BUCKET, args.s3_bucket) self.assertEqual(DIRECTORY, args.s3_directory) self.assertFalse(args.all) self.assertFalse(args.latest) self.assertEqual(args.user, 'me') self.assertEqual(args.password, 'passwd')
def test_get_args_with_credentials(self): args = get_args([ '--user', 'me', '--password', 'passwd', JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY ]) self.assertEqual(JOB_NAME, args.jenkins_job) self.assertEqual(BUILD_NUM, args.build_number) self.assertEqual(BUCKET, args.s3_bucket) self.assertEqual(DIRECTORY, args.s3_directory) self.assertFalse(args.all) self.assertFalse(args.latest) self.assertEqual(args.user, 'me') self.assertEqual(args.password, 'passwd')
def test_get_args_default(self): args = get_args([JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY]) self.assertEqual( args, Namespace(all=False, artifact_file_ext=None, build_number=1277, jenkins_job=JOB_NAME, latest=False, password=None, s3_bucket=BUCKET, s3_directory=DIRECTORY, unique_id=None, user=None, no_prefixes=False))
def test_get_args_artifact_file_ext(self): args = get_args([JOB_NAME, str(BUILD_NUM), BUCKET, DIRECTORY, '--artifact-file-ext', '.svg', '.json', '--unique-id', '1234']) self.assertEqual(args.artifact_file_ext, ['.svg', '.json']) self.assertEqual(args.unique_id, '1234')