Esempio n. 1
0
 def test_get_by_name(self):
     self.mox.StubOutWithMock(db, 'security_group_get_by_name')
     db.security_group_get_by_name(self.context, 'fake-project',
                                   'fake-name').AndReturn(fake_secgroup)
     self.mox.ReplayAll()
     secgroup = security_group.SecurityGroup.get_by_name(
         self.context, 'fake-project', 'fake-name')
     self.assertEqual(self._fix_deleted(fake_secgroup),
                      dict(secgroup.items()))
     self.assertEqual(secgroup.obj_what_changed(), set())
     self.assertRemotes()
Esempio n. 2
0
 def test_get_by_name(self):
     self.mox.StubOutWithMock(db, 'security_group_get_by_name')
     db.security_group_get_by_name(self.context, 'fake-project',
                                   'fake-name').AndReturn(fake_secgroup)
     self.mox.ReplayAll()
     secgroup = security_group.SecurityGroup.get_by_name(self.context,
                                                         'fake-project',
                                                         'fake-name')
     self.assertEqual(self._fix_deleted(fake_secgroup),
                      dict(secgroup.items()))
     self.assertEqual(secgroup.obj_what_changed(), set())
     self.assertRemotes()
Esempio n. 3
0
 def get_by_name(cls, context, project_id, group_name):
     db_secgroup = db.security_group_get_by_name(context, project_id,
                                                 group_name)
     return cls._from_db_object(context, cls(), db_secgroup)
Esempio n. 4
0
 def get_by_name(cls, context, project_id, group_name):
     db_secgroup = db.security_group_get_by_name(context,
                                                 project_id,
                                                 group_name)
     return cls._from_db_object(context, cls(), db_secgroup)