Exemplo n.º 1
0
def test_updateList_added(controller):
    cm = ComputeManager()
    computes = []
    compute = Compute()
    computes.append(compute)
    controller._http_client = MagicMock()
    cm.updateList(computes)
    assert compute.id() in cm._computes
    controller._http_client.createHTTPQuery.assert_called_with("POST", "/computes", None, body=compute.__json__())
Exemplo n.º 2
0
def test_updateList_added(controller):
    cm = ComputeManager()
    computes = []
    compute = Compute()
    computes.append(compute)
    controller._http_client = MagicMock()
    cm.updateList(computes)
    assert compute.id() in cm._computes
    controller._http_client.createHTTPQuery.assert_called_with(
        "POST", "/computes", None, body=compute.__json__())
Exemplo n.º 3
0
def test_init_without_id():
    compute = Compute()
    assert compute.id() is not None
Exemplo n.º 4
0
def test_init():
    compute = Compute("local")
    assert compute.id() == "local"