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)