def main(configfile, *args): setup(configfile) if '--archive' in args: archive.archive() else: sys.argv = [sys.argv[0]] + list(args) code.app.run()
def main(configfile, *args): load_config(configfile) if '--archive' in args: archive.archive() else: sys.argv = [sys.argv[0]] + list(args) code.app.run()
def test_archive(self): b = self.browser f1 = web.storage(olid='OL1M', filename='logos/logo-en.png') f2 = web.storage(olid='OL2M', filename='logos/logo-it.png') files = [f1, f2] for f in files: f.id = self.upload(f.olid, f.filename) f.path = join(static_dir, f.filename) assert b.open('/b/id/%d.jpg' % f.id).read() == open(f.path).read() archive.archive() for f in files: d = self.jsonget('/b/id/%d.json' % f.id) assert 'tar:' in d['filename'] assert b.open('/b/id/%d.jpg' % f.id).read() == open(f.path).read()
def test_archive(self): b = self.browser f1 = web.storage(olid='OL1M', filename='logos/logo-en.png') f2 = web.storage(olid='OL2M', filename='logos/logo-it.png') files = [f1, f2] for f in files: f.id = self.upload(f.olid, f.filename) f.path = join(static_dir, f.filename) assert b.open('/b/id/%d.jpg' % f.id).read() == open(f.path).read() archive.archive() for f in files: d = self.jsonget('/b/id/%d.json' % f.id) assert 'tar:' in d['filename'] assert b.open('/b/id/%d.jpg' % f.id).read() == open(f.path).read()
def test_archive(self): b = self.browser f1 = web.storage(olid="OL1M", filename="logos/logo-en.png") f2 = web.storage(olid="OL2M", filename="logos/logo-it.png") files = [f1, f2] for f in files: f.id = self.upload(f.olid, f.filename) f.path = os.path.join(static_dir, f.filename) assert b.open("/b/id/%d.jpg" % f.id).read() == open(f.path).read() archive.archive() for f in files: d = self.jsonget("/b/id/%d.json" % f.id) print f.id, d assert "tar:" in d["filename"] assert b.open("/b/id/%d.jpg" % f.id).read() == open(f.path).read()