

def test_delete_host(self):
    self.mox.StubOutWithMock(db, 'aggregate_host_delete')
    db.aggregate_host_delete(self.context, 123, 'foo')
    self.mox.ReplayAll()
    agg = aggregate.Aggregate()
    agg.id = 123
    agg.hosts = ['foo', 'bar']
    agg._context = self.context
    agg.delete_host('foo')
    self.assertEqual(agg.hosts, ['bar'])

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/objects/test_aggregate.py _TestAggregateObject.test_delete_host/original