

@mock.patch('nova.db.aggregate_get_by_metadata_key')
def test_get_by_metadata_key_and_hosts_no_match(self, get_by_metadata_key):
    get_by_metadata_key.return_value = [fake_aggregate]
    aggs = aggregate.AggregateList.get_by_metadata_key(self.context, 'this', hosts=['baz'])
    self.assertEqual(0, len(aggs))

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