Ejemplo n.º 1
0
 def test_should_fail_if_service_is_bad(self):
     testfs = [
         lambda: self._get_registry(),
         lambda: service.MethodRegistry(None),
         lambda: service.MethodRegistry(object()),
     ]
     for f in testfs:
         expect(f).to(raise_error(ValueError))
Ejemplo n.º 2
0
 def test_should_load_service_ok(self):
     loaded = service.Loaders.SIMPLE.load()
     registry = service.MethodRegistry(loaded)
     info = registry.lookup(u'GET', u'/anything')
     expect(info).not_to(be_none)
     info = registry.lookup(u'POST', u'/anything')
     expect(info).not_to(be_none)
Ejemplo n.º 3
0
 def _get_registry(self):
     return service.MethodRegistry(self._subject)
Ejemplo n.º 4
0
 def test_should_load_service_ok(self):
     loaded = service.Loaders.ENVIRONMENT.load()
     expect(loaded).not_to(be_none)
     registry = service.MethodRegistry(loaded)
     info = registry.lookup(u'GET', u'/shelves')
     expect(info).not_to(be_none)