コード例 #1
0
 def test_get_by_host(self):
     self.mox.StubOutWithMock(db, 'service_get_all_by_host')
     db.service_get_all_by_host(self.context, 'fake-host').AndReturn(
         [fake_service])
     self.mox.ReplayAll()
     services = service.ServiceList.get_by_host(self.context, 'fake-host')
     self.assertEqual(1, len(services))
     self.compare_obj(services[0], fake_service, allow_missing=OPTIONAL)
コード例 #2
0
ファイル: service.py プロジェクト: 2Exception/patron
 def get_by_host(cls, context, host):
     db_services = db.service_get_all_by_host(context, host)
     return base.obj_make_list(context, cls(context), objects.Service,
                               db_services)
コード例 #3
0
ファイル: service.py プロジェクト: hsluoyz/patron
 def get_by_host(cls, context, host):
     db_services = db.service_get_all_by_host(context, host)
     return base.obj_make_list(context, cls(context), objects.Service,
                               db_services)