Esempio n. 1
0
 def test_sha256(self):
     Settings.checksum = 'sha256'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(
         checksum,
         'd8669d49c8557ac47681f9b85e322849fa84186a8683c93959a590d6e7b9ae29')
Esempio n. 2
0
 def test_sha224(self):
     Settings.checksum = 'sha224'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(
         checksum,
         '01959559db8ef8d596ff824fe207fc0345be67df6b8a51942214adb7')
Esempio n. 3
0
 def test_sha512(self):
     Settings.checksum = 'sha512'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(
         checksum,
         '77a138fbd918610d55d9fd22868901bd189d987f17701498164badea88dd6f5612c118fc9e66d7b57f802bf0cddadc1cec54674ee1c3df2ddfaf1cac4007ac26'
     )
Esempio n. 4
0
 def test_sha384(self):
     Settings.checksum = 'sha384'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(
         checksum,
         '3d6a580100b1e8a40dc41892f6b289ff13c0b489b8079d8b7c01a17c67b88bf77283f784b4e8dacac6572050df8c948e'
     )
Esempio n. 5
0
 def test_checksum_command_line(self):
     sys.argv = [
         'fedora-review', '-n', 'python-test', '--prebuilt', '-k', 'sha1'
     ]
     Settings.init(True)
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '5315b33321883c15c19445871cd335f7f698a2aa')
Esempio n. 6
0
 def setUp(self):
     self.startdir = os.getcwd()
     sys.argv = ['test-checks', '-b', '1234']
     Settings.init(True)
     ReviewDirs.reset()
     ReviewDirs.workdir_setup('.', True)
     if not os.path.exists(TEST_WORK_DIR):
         os.makedirs(TEST_WORK_DIR)
     self.checks = None
     self.srpm = TEST_WORK_DIR + os.path.basename(TEST_SRPM)
     self.spec = TEST_WORK_DIR + os.path.basename(TEST_SPEC)
     self.source = TEST_WORK_DIR + os.path.basename(TEST_SRC)
     helper = Helpers()
     helper._get_file(TEST_SRPM, TEST_WORK_DIR)
     helper._get_file(TEST_SRC, TEST_WORK_DIR)
     helper._get_file(TEST_SPEC, TEST_WORK_DIR)
     del helper
Esempio n. 7
0
 def setUp(self):
     sys.argv = ['fedora-review', '-n', 'python-test', '--prebuilt']
     Settings.init(True)
     ReviewDirs.reset()
     ReviewDirs.workdir_setup('.', True)
     self.log = Settings.get_logger()
     self.helpers = Helpers()
     self.srpm_file = os.path.join(os.path.abspath('.'),
                                   os.path.basename(TEST_SRPM))
     self.spec_file = os.path.join(Mock.get_builddir('SOURCES'),
                                   os.path.basename(TEST_SPEC))
     self.source_file = os.path.join(Mock.get_builddir('SOURCES'),
                                     os.path.basename(TEST_SRC))
     if not os.path.exists(TEST_WORK_DIR):
         os.makedirs(TEST_WORK_DIR)
     self.helpers._get_file(TEST_SRPM, TEST_WORK_DIR)
     self.startdir = os.getcwd()
     for tree in ['python-test', 'results']:
         if os.path.exists(tree):
             shutil.rmtree(tree)
     Mock.reset()
Esempio n. 8
0
 def test_sha1(self):
     Settings.checksum = 'sha1'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '5315b33321883c15c19445871cd335f7f698a2aa')
Esempio n. 9
0
 def test_md5(self):
     Settings.checksum = 'md5'
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '4a1c937e62192753c550221876613f86')