def test_list_all(self):
     template = "%s\n  Sidecar files:\n   thumbnail: %s"
     expected = '\n'.join([template % (pic.filename,
                                       pic.get_thumbnail_filenames()[0])
                           for pic in self.repo.index.pics()])
     actual = app.list_pics(self.repo, 'all')
     self.assertEqual(actual, expected)
 def test_list_sidecars(self):
     expected = '\n'.join(['\n'.join(pic.get_sidecar_filenames())
                           for pic in self.repo.index.pics()])
     actual = app.list_pics(self.repo, 'sidecars')
     self.assertEqual(actual, expected)
 def test_list_checksums(self):
     expected = '\n'.join(['%s *%s' % (pic.checksum, pic.filename)
                           for pic in self.repo.index.pics()])
     actual = app.list_pics(self.repo, 'checksums')
     self.assertEqual(actual, expected)
Exemple #4
0
 def handle_list_cmd(self, conf):
     repo = app.load_repo(conf['working_dir'])
     print app.list_pics(repo, conf['list.mode'])
     return 0