def test_get_mesos_gpu_status(): metrics = { 'master/gpus_total': 3, 'master/gpus_used': 1, } actual = metastatus_lib.get_mesos_gpu_status(metrics) assert actual == (3, 1, 2)
def test_get_mesos_gpu_status(): metrics = {"master/gpus_total": 10, "master/gpus_used": 5} fake_mesos_state = { "slaves": [{"reserved_resources": {"maintenance": {"gpus": 2}}}] } actual = metastatus_lib.get_mesos_gpu_status(metrics, fake_mesos_state) assert actual == (10, 7, 3)
def test_get_mesos_gpu_status(): metrics = { 'master/gpus_total': 10, 'master/gpus_used': 5, } fake_mesos_state = { 'slaves': [ { 'reserved_resources': { 'maintenance': { 'gpus': 2, }, }, }, ], } actual = metastatus_lib.get_mesos_gpu_status(metrics, fake_mesos_state) assert actual == (10, 7, 3)