class TestJarFinder(MatchTestTemplate, TestWithTmpDir): def add(self, path): self.jar.add(path, path, compress=True) def do_check(self, pattern, result): do_check(self, self.finder, pattern, result) def test_jar_finder(self): self.jar = JarWriter(file=self.tmppath('test.jar')) self.prepare_match_test() self.jar.finish() reader = JarReader(file=self.tmppath('test.jar')) self.finder = JarFinder(self.tmppath('test.jar'), reader) self.do_match_test()
class TestJarFinder(MatchTestTemplate, TestWithTmpDir): def add(self, path): self.jar.add(path, path, compress=True) def do_check(self, pattern, result): do_check(self, self.finder, pattern, result) def test_jar_finder(self): self.jar = JarWriter(file=self.tmppath('test.jar')) self.prepare_match_test() self.jar.finish() reader = JarReader(file=self.tmppath('test.jar')) self.finder = JarFinder(self.tmppath('test.jar'), reader) self.do_match_test()
class TestJarFinder(MatchTestTemplate, TestWithTmpDir): def add(self, path): self.jar.add(path, ensure_bytes(path), compress=True) def do_check(self, pattern, result): do_check(self, self.finder, pattern, result) def test_jar_finder(self): self.jar = JarWriter(file=self.tmppath("test.jar")) self.prepare_match_test() self.jar.finish() reader = JarReader(file=self.tmppath("test.jar")) self.finder = JarFinder(self.tmppath("test.jar"), reader) self.do_match_test() self.assertIsNone(self.finder.get("does-not-exist")) self.assertIsInstance(self.finder.get("bar"), DeflatedFile)
class TestJarFinder(MatchTestTemplate, TestWithTmpDir): def add(self, path): self.jar.add(path, path, compress=True) def do_check(self, pattern, result): do_check(self, self.finder, pattern, result) def test_jar_finder(self): self.jar = JarWriter(file=self.tmppath('test.jar')) self.prepare_match_test() self.jar.finish() reader = JarReader(file=self.tmppath('test.jar')) self.finder = JarFinder(self.tmppath('test.jar'), reader) self.do_match_test() self.assertIsNone(self.finder.get('does-not-exist')) self.assertIsInstance(self.finder.get('bar'), DeflatedFile)