def test_pre_set_header(): replog = ResultLog() d = replog.dict assert replog.dict == d assert replog.dict["reportversion"] == "1" assert replog.dict["toxversion"] == tox.__version__ assert replog.dict["platform"] == sys.platform assert replog.dict["host"] == socket.getfqdn() data = replog.dumps_json() replog2 = ResultLog.from_json(data) assert replog2.dict == replog.dict
def test_set_header(pkg): replog = ResultLog() d = replog.dict assert replog.dict == d assert replog.dict["reportversion"] == "1" assert replog.dict["toxversion"] == tox.__version__ assert replog.dict["platform"] == sys.platform assert replog.dict["host"] == socket.getfqdn() expected = {"basename": "hello-1.0.tar.gz", "sha256": pkg.computehash("sha256")} env_log = replog.get_envlog("a") env_log.set_header(installpkg=pkg) assert env_log.dict["installpkg"] == expected data = replog.dumps_json() replog2 = ResultLog.from_json(data) assert replog2.dict == replog.dict