def test_delete(patch_client): setattr(__builtin__, "NS", maps.NamedDict()) setattr(NS, "_int", maps.NamedDict()) NS._int.wclient = "Temp_obj" patch_client.return_value = etcd.Client() NS._int.etcd_kwargs = {'port': 1, 'host': 2, 'allow_reconnect': True} wreconnect() delete()
def test_wreconnect(patch_client): setattr(__builtin__, "NS", maps.NamedDict()) setattr(NS, "_int", maps.NamedDict()) patch_client.return_value = etcd.Client() NS._int.etcd_kwargs = {'port': 1, 'host': 2, 'allow_reconnect': True} wreconnect() with patch.object(etcd, 'Client', client): with patch.object(time, 'sleep', sleep): wreconnect()
def test_delete(patch_client): setattr(__builtin__, "NS", maps.NamedDict()) setattr(NS, "_int", maps.NamedDict()) NS._int.wclient = "Temp_obj" patch_client.return_value = etcd.Client() NS._int.etcd_kwargs = { 'port': 1, 'host': 2, 'allow_reconnect': True} wreconnect() delete()
def test_wreconnect(patch_client): setattr(__builtin__, "NS", maps.NamedDict()) setattr(NS, "_int", maps.NamedDict()) patch_client.return_value = etcd.Client() NS._int.etcd_kwargs = { 'port': 1, 'host': 2, 'allow_reconnect': True} wreconnect() with patch.object(etcd, 'Client', client): with patch.object(time, 'sleep', sleep): with pytest.raises(etcd.EtcdException): wreconnect()