Пример #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))
Пример #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)
Пример #3
0
 def _get_registry(self):
     return service.MethodRegistry(self._subject)
Пример #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)