def test_binary_create_init(self): options = {'jvm_binary_create_outdir': None, 'binary_create_compressed': None, 'binary_create_zip64': None, 'jvm_binary_create_deployjar': None} binary_create = BinaryCreate(create_context(config=sample_ini_test_1, options=options)) self.assertEquals(binary_create.outdir, '/tmp/dist')
def test_jar_create_init(self): ini = dedent(""" [DEFAULT] pants_workdir: /tmp/pants.d pants_supportdir: /tmp/build-support """).strip() jar_create = JarCreate(create_context(config=ini, options=self.create_options())) self.assertEquals(jar_create._output_dir, '/tmp/pants.d/jars') self.assertEquals(jar_create.confs, ['default'])
def context(self, config='', **options): opts = dict(jar_create_outdir=self.jar_outdir) opts.update(**options) return create_context(config=config, options=self.create_options(**opts), target_roots=[self.jl, self.sl, self.jtl])
def test_fail_fast_error_raised(self): options = {'fail_fast': True} task = DuplicateDetector(create_context(options=options)) with pytest.raises(TaskError): task._is_conflicts(self.path_with_duplicates, None)
def test_duplicate_not_found(self): options = {'fail_fast': False} task = DuplicateDetector(create_context(options=options)) self.assertFalse(task._is_conflicts(self.path_without_duplicates, None))
def test_fail_fast_error_raised(self): options = {'fail_fast': True} task = DuplicateDetector(create_context(options=options)) with pytest.raises(TaskError): task._is_conflicts(self.path_with_duplicates, None)
def test_duplicate_not_found(self): options = {'fail_fast': False} task = DuplicateDetector(create_context(options=options)) self.assertFalse(task._is_conflicts(self.path_without_duplicates, None))