def test_01_Name(self): HEADING() n = Name(experiment="exp", group="grp", user="******", kind="vm", counter=1) n.reset() assert n.counter == 1 print(n) assert str(n) == "exp-grp-gregor-vm-1" pprint(n.dict()) print(n.get("container")) print(n) assert str(n) == "exp-grp-gregor-container-1" n.incr() print(n) assert str(n) == "exp-grp-gregor-container-2" print(n.counter) assert n.counter == 2 m = Name() pprint(n.dict()) pprint(m.dict()) print(m) assert str(n) == str(m)
def test_define(self): HEADING() Benchmark.Start() n = Name(**data) Benchmark.Stop() VERBOSE(data) VERBOSE(n.dict()) assert dict(data) == n.dict()
def test_name_dict(self): HEADING() n = Name() pprint(n.dict()) Benchmark.Start() data = n.dict() Benchmark.Stop() assert data == dict({ 'schema': '{user}-{kind}-{counter}', 'counter': 1, 'user': username, 'kind': 'vm'})
def test_name_dict(self): n = Name() pprint(n.dict()) Benchmark.Start() data = n.dict() Benchmark.Stop() assert data == dict({ 'counter': 1, 'kind': 'vm', 'path': '/Users/grey/.cloudmesh/name.yaml', 'schema': '{user}-{kind}-{counter}', 'user': '******' })
def test_name_counter(self): n = Name() Benchmark.Start() c = n.counter Benchmark.Stop() print(n.counter) assert n.counter == 2 m = Name() pprint(n.dict()) pprint(m.dict()) print(m) assert str(n) == str(m)
def test_define_new(self): HEADING() os.remove(path) Benchmark.Start() n = Name(schema="{user}-{kind}-{counter}", counter="3", user=username, kind="vm") Benchmark.Stop() data = n.dict() pprint(data) assert data == dict({ 'schema': '{user}-{kind}-{counter}', 'counter': 3, 'user': username, 'kind': 'vm'})
def test_define_new(self): os.remove(path) Benchmark.Start() n = Name(schema="{user}-{kind}-{counter}", counter="3", user="******", kind="vm") Benchmark.Stop() data = n.dict() pprint(data) assert data == dict({ 'counter': 3, 'kind': 'vm', 'path': '/Users/grey/.cloudmesh/name.yaml', 'schema': '{user}-{kind}-{counter}', 'user': '******' })
def test_define(self): Benchmark.Start() n = Name() Benchmark.Stop() assert dict(data) == n.dict()