# import unittest import re import sys import xml.etree.ElementTree as ET from tonic.cache import hub from tonic.cache.imp import Dict from tonic.visitbus import Requests from tonic.visitbus import merge from tonic.visitbus import vpath2regexp from tonic.visitbus import VisitPassenger from tonic.visitbus import VisitBus hub.connect(Dict()) class VPathTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_absroot(self): query = '''/root''' m = vpath2regexp(query) self.assert_(m) self.assert_(m.match('/root>')) def test_absrootdown(self): query = '''/root>'''
def setUp(self): hub.connect('dict')
def setUp(self): self.workdir = tempfile.mkdtemp() hub.connect('disk', self.workdir)
def setUp(self): IP = '127.0.0.1' PORT = 22222 self.memcached = MemcacheTestingServer(IP, PORT) hub.connect('memcache', ['%s:%i'%(IP, PORT)])
def setUp(self): ip = '127.0.0.1' port = 22222 self.server = MemcacheTestingServer(ip, port) hub.connect(Memcache(['%s:%i'%(ip, port)]))
def setUp(self): os.stat_float_times(True) hub.connect(Dict())
def setUp(self): os.stat_float_times(True) hub.connect(Hierachy(levels=[Dict(),Dict()]))
def setUp(self): os.stat_float_times(True) hub.connect(File(workdir=tempfile.mkdtemp()))