aboutsummaryrefslogtreecommitdiffstats
path: root/moon_orchestrator/tests/unit_python/test_slaves.py
blob: 88ff7e55321ee0f60d1ab91829665555423a90ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import json
from mock_pods import patch_k8s
from utilities import get_json


def test_get_slaves(context, monkeypatch):
    patch_k8s(monkeypatch)

    import moon_orchestrator.server
    server = moon_orchestrator.server.create_server()
    _client = server.app.test_client()
    req = _client.get("/slaves")
    assert req.status_code == 200
    assert req.data
    data = get_json(req.data)
    assert isinstance(data, dict)
    assert "slaves" in data