

def test_save_and_create_no_hosts(self):
    agg = aggregate.Aggregate(context=self.context)
    agg.id = 123
    agg.hosts = ['foo', 'bar']
    agg.assertRaises(exception.ObjectActionError, agg.create)
    self.assertRaises(exception.ObjectActionError, agg.save)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/objects/test_aggregate.py _TestAggregateObject.test_save_and_create_no_hosts/VarMisuse@39/50 `self`->`agg`