Example #1
0
 def test_find_in_catalog_selected_catalog_not_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catho.create_catalog(self.name + '_copy', self.path, 'sha1')
     items = catho.find_in_catalogs('not_existing_file.ext',
                                    (self.name, self.name + '_copy'))
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) == 0)
Example #2
0
 def test_find_in_catalog_selected_catalog_not_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catho.create_catalog(self.name + '_copy', self.path, 'sha1')
     items = catho.find_in_catalogs('not_existing_file.ext',
                                    (self.name, self.name + '_copy'))
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) == 0)
Example #3
0
 def test_find_in_catalog_one_catalog_one_or_more_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     items = catho.find_in_catalogs('test_catalog.py', ('test', ))
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) > 0)
Example #4
0
 def test_find_in_catalogs_all_catalogs_two_or_more_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catho.create_catalog(self.name + '_copy', self.path, 'sha1')
     items = catho.find_in_catalogs('test_catalog.py')
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) > 1)
Example #5
0
 def test_catalog_str(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     str = catho.catalog_str(self.name)
     self.assertTrue(str)
Example #6
0
 def test_file_rm_catalog_file(self):
     catho.create_catalog(self.name, self.path, 'sha1', True)
     catho.file_rm_catalog_file([self.name])
     return
Example #7
0
 def test_db_get_catalog(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catalog = catho.db_get_catalog(self.name)
     self.assertTrue(catalog)
     self.assertTrue(len(catalog) > 0)
Example #8
0
 def test_db_get_metadata(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     metadata = catho.db_get_metadata(self.name)
     self.assertTrue(metadata)
     self.assertTrue(len(metadata) == 7)
Example #9
0
 def test_update_catalog(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     utils.file_touch_file(self.name + "2")
     utils.file_touch_file(self.name + "3")
     catho.update_catalog(self.name, self.path)
Example #10
0
 def test_find_in_catalogs_all_catalogs_two_or_more_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catho.create_catalog(self.name + '_copy', self.path, 'sha1')
     items = catho.find_in_catalogs('test_catalog.py')
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) > 1)
Example #11
0
 def test_find_in_catalog_one_catalog_one_or_more_matches(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     items = catho.find_in_catalogs('test_catalog.py', ('test',))
     items = [f for catalog, files in items.items() for f in files]
     self.assertTrue(len(items) > 0)
Example #12
0
 def test_catalog_str(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     str = catho.catalog_str(self.name)
     self.assertTrue(str)
Example #13
0
 def test_file_rm_catalog_file(self):
     catho.create_catalog(self.name, self.path, 'sha1', True)
     catho.file_rm_catalog_file([self.name])
     return
Example #14
0
 def test_db_get_catalog(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     catalog = catho.db_get_catalog(self.name)
     self.assertTrue(catalog)
     self.assertTrue(len(catalog) > 0)
Example #15
0
 def test_db_get_metadata(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     metadata = catho.db_get_metadata(self.name)
     self.assertTrue(metadata)
     self.assertTrue(len(metadata) == 7)
Example #16
0
 def test_update_catalog(self):
     catho.create_catalog(self.name, self.path, 'sha1')
     utils.file_touch_file(self.name + "2")
     utils.file_touch_file(self.name + "3")
     catho.update_catalog(self.name, self.path)