コード例 #1
0
ファイル: test_hostconfig.py プロジェクト: sobigwind/Paradrop
def test_getHostconfig(prepareHostConfig):
    """
    Test paradrop.core.config.hostconfig.getHostConfig
    """
    from paradrop.core.config.hostconfig import getHostConfig

    update = MagicMock()
    getHostConfig(update)
    assert update.cache_set.called
コード例 #2
0
def test_getHostconfig(prepareHostConfig):
    """
    Test paradrop.core.config.hostconfig.getHostConfig
    """
    from paradrop.core.config.hostconfig import getHostConfig

    update = MagicMock()
    getHostConfig(update)
    assert update.cache_set.called
コード例 #3
0
def test_patchHostconfig(prepareHostConfig):
    from paradrop.core.config.hostconfig import getHostConfig

    update = MagicMock()
    update.updateType = "patchhostconfig"

    patch = [
        {"op": "replace", "path": "/zerotier/enabled", "value": True},
        {"op": "add", "path": "/zerotier/networks", "value": "e5cd7a9e1c2753e4"}
    ]

    getHostConfig(update)
    assert update.cache_set.called
コード例 #4
0
ファイル: test_hostconfig.py プロジェクト: sobigwind/Paradrop
def test_patchHostconfig(prepareHostConfig):
    from paradrop.core.config.hostconfig import getHostConfig

    update = MagicMock()
    update.updateType = "patchhostconfig"

    patch = [{
        "op": "replace",
        "path": "/zerotier/enabled",
        "value": True
    }, {
        "op": "add",
        "path": "/zerotier/networks",
        "value": "e5cd7a9e1c2753e4"
    }]

    getHostConfig(update)
    assert update.cache_set.called