def test_source_file(self): """ Test the SourceFile class """ if os.path.exists('python-test'): shutil.rmtree('python-test') sys.argv = ['fedora-review', '-n', 'python-test'] Settings.init(True) ReviewDirs.reset() ReviewDirs.workdir_setup('.', True) bug = NameBug('python-test') bug.find_urls() bug.download_files() spec = SpecFile(bug.spec_file) sources = Sources(spec) source = Source(sources, 'Source0', TEST_SRC) # check that source exists and source.filename point to the right location expected = os.path.abspath('./upstream/python-test-1.0.tar.gz') self.assertEqual(source.filename, expected) self.assertEqual(source.is_archive(), True) self.assertTrue(os.path.exists(source.filename)) self.assertEqual( source.check_source_checksum(), "7ef644ee4eafa62cfa773cad4056cdcea592e27dacd5ae" "b4e8b11f51f5bf60d3") os.chdir(self.startdir)
def test_source_file(self): """ Test the SourceFile class """ self.init_test('test_misc', argv=['-n','python-test', '--cache', '--no-build']) source = Source('Source0', self.BASE_URL + 'python-test-1.0.tar.gz') # check that source exists and source.filename point to the right location expected = os.path.abspath('upstream/python-test-1.0.tar.gz') self.assertEqual(source.filename, expected) self.assertEqual(source.is_archive(), True) self.assertTrue(os.path.exists(source.filename)) self.assertEqual(source.check_source_checksum(), "7ef644ee4eafa62cfa773cad4056cdcea592e27dacd5ae" "b4e8b11f51f5bf60d3")
def test_source_file(self): """ Test the SourceFile class """ if os.path.exists('python-test'): shutil.rmtree('python-test') sys.argv = ['fedora-review','-n','python-test'] Settings.init(True) ReviewDirs.reset() ReviewDirs.workdir_setup('.', True) bug = NameBug('python-test') bug.find_urls() bug.download_files() spec = SpecFile(bug.spec_file) sources = Sources(spec) source = Source(sources, 'Source0', TEST_SRC) # check that source exists and source.filename point to the right location expected = os.path.abspath('./upstream/python-test-1.0.tar.gz') self.assertEqual(source.filename, expected) self.assertEqual(source.is_archive(), True) self.assertTrue(os.path.exists(source.filename)) self.assertEqual(source.check_source_checksum(), "7ef644ee4eafa62cfa773cad4056cdcea592e27dacd5ae" "b4e8b11f51f5bf60d3") os.chdir(self.startdir)
def test_source_file(self): """ Test the SourceFile class """ source = Source() # set the work dir source.set_work_dir(TEST_WORK_DIR) # download the upstream source file source.get_source(TEST_SRC) # check that source exists and source.filename point to the right location self.assertEqual(source.filename, self.source_file) self.assertTrue(os.path.exists(self.source_file)) self.assertEqual(source.check_source_md5(), "289cb714af3a85fe36a51fa3612b57ad")