Exemplo n.º 1
0
 def test_getzipfile(self):
     conf = self.get_conf()
     w = Worker(conf)
     p = w.get_zipfile("http://localhost:9000/download/test.zip",
                     conf['app']['internaltoken'],
                     "/tmp/")
     assert p == "/tmp/test.zip"
     assert os.path.exists("/tmp/test.zip")
Exemplo n.º 2
0
    def test_do_sphinx(self):
        conf = self.get_conf()
        w = Worker(conf)
        p = w.get_zipfile("http://localhost:9000/download/test.zip",
                        conf['app']['internaltoken'],
                        "/tmp/")

        d = w.extract(p, "/tmp/")
        req = {}
        print w.do_sphinx(d, req, conf)
Exemplo n.º 3
0
    def test_extract(self):
        conf = self.get_conf()
        w = Worker(conf)
        p = w.get_zipfile("http://localhost:9000/download/test.zip",
                        conf['app']['internaltoken'],
                        "/tmp/")

        d = w.extract(p, "/tmp/")
        assert d.startswith("/tmp/")
        assert os.path.isdir(d)

        shutil.rmtree(d)