def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/testfile.html" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector)
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "URL:http://gopher.quux.org/" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = None
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/0/README" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = None
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) # The "hello" will be sent as an additional script argument. Multiple # query arguments can be provided using " " as the separator. self.selector = "/pygopherd/cgitest.sh?hello" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = None
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/testdata.zip" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector) self.config.set("handlers.ZIP.ZIPHandler", "enabled", "true")
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/testfile.txt.gz" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector) self.config.set( "handlers.file.CompressedFileHandler", "decompressors", "{'gzip' : 'zcat'}" )
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/talsample.html.tal" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector) # Initialize the custom mimetypes encoding map initialization.init_logger(self.config, "") initialization.init_mimetypes(self.config)
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector) # Make sure there's no directory cache file from a previous test run cachefile = self.config.get("handlers.dir.DirHandler", "cachefile") try: os.remove(self.vfs.getfspath(self.selector) + "/" + cachefile) except OSError: pass
def test_spartan(self): proto = get_testing_protocol("localhost / 0\n") self.assertIsInstance(proto, spartan.SpartanProtocol)
def test_gopher_plus(self): proto = get_testing_protocol("/gopher+-request.txt\t+\n") self.assertIsInstance(proto, gopherp.GopherPlusProtocol)
def test_secure_gopher(self): proto = get_testing_protocol("/gopher0-request.txt\n", use_tls=True) self.assertIsInstance(proto, rfc1436.SecureGopherProtocol)
def test_secure_gopher_plus(self): proto = get_testing_protocol("/gopher+-request.txt\t+\n", use_tls=True) self.assertIsInstance(proto, gopherp.SecureGopherPlusProtocol)
def setUp(self): self.config = testutil.get_config() self.vfs = VFS_Real(self.config) self.selector = "/python-dev.mbox" self.protocol = testutil.get_testing_protocol(self.selector, config=self.config) self.stat_result = self.vfs.stat(self.selector)
def test_http(self): proto = get_testing_protocol("GET /http-request.txt HTTP/1.0\n\n") self.assertIsInstance(proto, http.HTTPProtocol)
def test_gopher(self): proto = get_testing_protocol("/gopher0-request.txt\n") self.assertIsInstance(proto, rfc1436.GopherProtocol)
def test_https(self): proto = get_testing_protocol("GET /http-request.txt HTTP/1.0\n\n", use_tls=True) self.assertIsInstance(proto, http.HTTPSProtocol)
def test_gemini(self): proto = get_testing_protocol("gemini://example.com\n", use_tls=True) self.assertIsInstance(proto, gemini.GeminiProtocol)
def test_wap(self): proto = get_testing_protocol("GET /wap/http-request.txt HTTP/1.0\n\n") self.assertIsInstance(proto, wap.WAPProtocol)