MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_worker_resources_display

Function test_worker_resources_display

tests/test_resources.py:16–36  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

14
15
16def test_worker_resources_display(hq_env: HqEnv):
17 hq_env.start_server()
18 hq_env.start_worker(
19 cpus="4x2",
20 args=[
21 "--resource",
22 "potato=range(1-12)",
23 "--resource",
24 "fairy=sum(1000_1000)",
25 "--resource",
26 "shark=[1,3,5,2]",
27 "--resource",
28 "small=sum(0.5)",
29 ],
30 )
31 table = hq_env.command(["worker", "list"], as_table=True)
32 assert table.get_column_value("Resources") == ["cpus 4x2; fairy 10001000; potato 12; shark 4; small 0.5"]
33
34 table = hq_env.command(["worker", "info", "1"], as_table=True)
35 print(table.get_row_value("Resources"))
36 assert table.get_row_value("Resources") == "cpus: 4x2\nfairy: 10001000\npotato: 12\nshark: 4\nsmall: 0.5"
37
38
39def test_task_resources_ignore_worker_without_resource(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 5

commandMethod · 0.80
get_column_valueMethod · 0.80
get_row_valueMethod · 0.80
start_serverMethod · 0.45
start_workerMethod · 0.45

Tested by

no test coverage detected