

def test_get_pool_does_not_create_new_pool_if_exists(self):
    pool_info = {
        'address': '127.0.0.1',
        'username': 'test',
        'password': '1234pass',
        'host': self.console.host,
        'console_type': self.console.driver.console_type,
        'compute_host': 'sometesthostname',
    }
    new_pool = db.console_pool_create(self.context, pool_info)
    pool = self.console._get_pool_for_instance_host(self.context, 'sometesthostname')
    self.assertEqual(pool['id'], new_pool['id'])

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/console/test_console.py ConsoleTestCase.test_get_pool_does_not_create_new_pool_if_exists/original