Beispiel #1
0
 def test_download(self):
     test_dir = tempfile.mkdtemp()
     self.dirs.append(test_dir)
     rd = RemoteDistribution(
         self.mock_repo(),
         '../../packages/source/p/pkgsync/pkgsync-0.1.0.tar.gz#md5=%s' % self.empty_digest,
         'pkgsync',
     )
     dist = rd.download(save_to=test_dir)
     downloaded_file_path = os.path.join(test_dir, 'pkgsync-0.1.0.tar.gz')
     self.assertTrue(os.path.isfile(downloaded_file_path))
     self.assertEqual(dist.path, downloaded_file_path)
Beispiel #2
0
 def test_up_to_date(self):
     distribution = RemoteDistribution(
         self.mock_repo(),
         '../../packages/source/p/pkgsync/pkgsync-0.1.0.tar.gz#md5=%s' % self.empty_digest,
         'pkgsync',
     )
     self.assertEqual(RemoteDistribution.diff([distribution], [distribution]), [])
Beispiel #3
0
 def test_tgz_and_zip(self):
     repo = self.mock_repo()
     tgz_d = RemoteDistribution(
         repo,
         '../../packages/source/p/pkgsync/pkgsync-0.1.0.tar.gz#md5=%s' % self.empty_digest,
         'pkgsync',
     )
     zip_d = RemoteDistribution(
         repo,
         '../../packages/source/p/pkgsync/pkgsync-0.1.0.zip#md5=%s' % self.empty_digest,
         'pkgsync',
     )
     self.assertEqual(RemoteDistribution.diff([zip_d, tgz_d], [tgz_d]), [zip_d])
Beispiel #4
0
 def test_empty_diff(self):
     self.assertEqual(RemoteDistribution.diff([], []), [])