Exemplo n.º 1
0
def test_appliance_json_with_platform():
    a = Appliance(None, {
        "node_type": "dynamips",
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": 0,
        "symbol": "dynamips.svg",
        "server": "local",
        "platform": "c3725"
    })
    assert a.__json__() == {
        "appliance_id": a.id,
        "node_type": "dynamips",
        "builtin": False,
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": "router",
        "symbol": "dynamips.svg",
        "compute_id": "local",
        "platform": "c3725"
    }
Exemplo n.º 2
0
def test_appliance_json_with_not_known_category():
    a = Appliance(None, {
        "node_type": "qemu",
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": 'Not known',
        "symbol": "qemu.svg",
        "server": "local",
        "platform": None
    })
    assert a.__json__() == {
        "appliance_id": a.id,
        "node_type": "qemu",
        "builtin": False,
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": "Not known",
        "symbol": "qemu.svg",
        "compute_id": "local",
        "platform": None
    }
Exemplo n.º 3
0
def test_appliance_json_with_platform():
    a = Appliance(
        None, {
            "node_type": "dynamips",
            "name": "Test",
            "default_name_format": "{name}-{0}",
            "category": 0,
            "symbol": "dynamips.svg",
            "server": "local",
            "platform": "c3725"
        })
    assert a.__json__() == {
        "appliance_id": a.id,
        "node_type": "dynamips",
        "builtin": False,
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": "router",
        "symbol": "dynamips.svg",
        "compute_id": "local",
        "platform": "c3725"
    }
Exemplo n.º 4
0
def test_appliance_json_with_not_known_category():
    a = Appliance(
        None, {
            "node_type": "qemu",
            "name": "Test",
            "default_name_format": "{name}-{0}",
            "category": 'Not known',
            "symbol": "qemu.svg",
            "server": "local",
            "platform": None
        })
    assert a.__json__() == {
        "appliance_id": a.id,
        "node_type": "qemu",
        "builtin": False,
        "name": "Test",
        "default_name_format": "{name}-{0}",
        "category": "Not known",
        "symbol": "qemu.svg",
        "compute_id": "local",
        "platform": None
    }