예제 #1
0
 def test_stored_hashes(self):
     test_album = self.mk_test_album()
     ipfs = IPFSPlugin()
     added_albums = ipfs.ipfs_added_albums(self.lib, self.lib.path)
     added_album = added_albums.get_album(1)
     self.assertEqual(added_album.ipfs, test_album.ipfs)
     found = False
     want_item = test_album.items()[2]
     for check_item in added_album.items():
         try:
             if check_item.ipfs:
                 want_path = '/ipfs/{0}/{1}'.format(
                     test_album.ipfs, os.path.basename(want_item.path))
                 self.assertEqual(check_item.path, want_path)
                 self.assertEqual(check_item.ipfs, want_item.ipfs)
                 self.assertEqual(check_item.title, want_item.title)
                 found = True
         except AttributeError:
             pass
     self.assertTrue(found)
예제 #2
0
 def test_stored_hashes(self):
     test_album = self.mk_test_album()
     ipfs = IPFSPlugin()
     added_albums = ipfs.ipfs_added_albums(self.lib, self.lib.path)
     added_album = added_albums.get_album(1)
     self.assertEqual(added_album.ipfs, test_album.ipfs)
     found = False
     want_item = test_album.items()[2]
     for check_item in added_album.items():
         try:
             if check_item.ipfs:
                 want_path = "/ipfs/{0}/{1}".format(test_album.ipfs, os.path.basename(want_item.path))
                 want_path = bytestring_path(want_path)
                 self.assertEqual(check_item.path, want_path)
                 self.assertEqual(check_item.ipfs, want_item.ipfs)
                 self.assertEqual(check_item.title, want_item.title)
                 found = True
         except AttributeError:
             pass
     self.assertTrue(found)
예제 #3
0
 def test_stored_hashes(self):
     test_album = self.mk_test_album()
     ipfs = IPFSPlugin()
     added_albums = ipfs.ipfs_added_albums(self.lib, self.lib.path)
     added_album = added_albums.get_album(1)
     self.assertEqual(added_album.ipfs, test_album.ipfs)
     found = False
     want_item = test_album.items()[2]
     for check_item in added_album.items():
         try:
             if check_item.get('ipfs', with_album=False):
                 ipfs_item = os.path.basename(want_item.path).decode(
                     _fsencoding(), )
                 want_path = '/ipfs/{}/{}'.format(test_album.ipfs,
                                                  ipfs_item)
                 want_path = bytestring_path(want_path)
                 self.assertEqual(check_item.path, want_path)
                 self.assertEqual(check_item.get('ipfs', with_album=False),
                                  want_item.ipfs)
                 self.assertEqual(check_item.title, want_item.title)
                 found = True
         except AttributeError:
             pass
     self.assertTrue(found)