'Tests the get_host function.'

def test_get_host(self):

    my_host_name = 'myhost'
    my_host = mock.MagicMock()
    my_host.host_name = my_host_name
    my_host.service = 'compute'
    wrong_host = mock.MagicMock()
    wrong_host.host_name = 'wrong_host'
    wrong_host.service = 'compute'
    self.nova_client.hosts.list.side_effect = [[my_host], [wrong_host], exception.EntityNotFound(entity='Host', name='nohost')]
    self.assertEqual(my_host, self.nova_plugin.get_host(my_host_name))
    self.assertRaises(exception.EntityNotFound, self.nova_plugin.get_host, my_host_name)
    self.assertRaises(exception.EntityNotFound, self.nova_plugin.get_host, 'nohost')
    self.assertEqual(3, self.nova_client.hosts.list.call_count)
    calls = [mock.call(), mock.call(), mock.call()]
    self.assertEqual(calls, self.nova_client.hosts.list.call_args_list)
