def test_wait_for_hm_port_bound(self):
    self.patch_object(api_crud.tenacity, 'Retrying')

    @contextlib.contextmanager
    def fake_context_manager():
        (yield None)
    self.Retrying.return_value = [fake_context_manager()]
    self.patch_object(api_crud, 'is_hm_port_bound')
    self.is_hm_port_bound.return_value = True
    self.assertTrue(api_crud.wait_for_hm_port_bound('ids', 'fake-unit-name'))
    self.Retrying.side_effect = api_crud.tenacity.RetryError(None)
    self.assertFalse(api_crud.wait_for_hm_port_bound('ids', 'fake-unit-name'))
def test_wait_for_hm_port_bound(self):
    self.patch_object(api_crud.tenacity, 'Retrying')

    @contextlib.contextmanager
    def fake_context_manager():
        (yield None)
    self.Retrying.return_value = [fake_context_manager()]
    self.patch_object(api_crud, 'is_hm_port_bound')
    self.is_hm_port_bound.return_value = True
    self.assertTrue(api_crud.wait_for_hm_port_bound('ids', 'fake-unit-name'))
    self.Retrying.side_effect = api_crud.tenacity.RetryError(None)
    self.assertFalse(api_crud.wait_for_hm_port_bound('ids', 'fake-unit-name'))