def setUp(self): super(TestGroup, self).setUp() self.sess = mock.Mock(spec=adapter.Adapter) self.sess.get = mock.Mock() self.sess.post = mock.Mock() self.sess.delete = mock.Mock() self.sess.put = mock.Mock() self.sess.get_project_id = mock.Mock() self.sot = group.Group(**EXAMPLE)
def test_basic(self): sot = group.Group() self.assertEqual('scaling_group', sot.resource_key) self.assertEqual('scaling_groups', sot.resources_key) self.assertEqual('/scaling_group', sot.base_path) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_get) self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete)
def test_make_it_extend(self): sot = group.Group(**EXAMPLE_EXTEND) self.assertEqual(EXAMPLE_EXTEND['scaling_group_id'], sot.id) self.assertEqual(EXAMPLE_EXTEND['scaling_group_name'], sot.name) self.assertEqual(EXAMPLE_EXTEND['create_time'], sot.create_time) self.assertEqual(EXAMPLE_EXTEND['lbaas_listeners'], sot.lbaas_listeners) self.assertEqual(EXAMPLE_EXTEND['health_periodic_audit_grace_period'], sot.health_periodic_audit_grace_period) self.assertEqual(EXAMPLE_EXTEND['delete_volume'], sot.delete_volume) self.assertEqual(EXAMPLE_EXTEND['multi_az_priority_policy'], sot.multi_az_priority_policy)
def test_make_it(self): sot = group.Group(**EXAMPLE) self.assertEqual(EXAMPLE['scaling_group_id'], sot.id) self.assertEqual(EXAMPLE['scaling_group_name'], sot.name) self.assertEqual(EXAMPLE['create_time'], sot.create_time)