コード例 #1
0
ファイル: test_utils.py プロジェクト: nathan-weinberg/commons
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()
コード例 #2
0
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()
コード例 #3
0
ファイル: test_utils.py プロジェクト: Tendrl/bridge_common
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()
コード例 #4
0
ファイル: test_utils.py プロジェクト: Tendrl/bridge_common
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()