Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pyfarm/pyfarm-agent into remove_h…
Browse files Browse the repository at this point in the history
…ttps_testing
  • Loading branch information
opalmer committed Sep 2, 2015
2 parents 76fc32b + ef7df85 commit 9300723
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/test_agent/test_http_api_state.py
Expand Up @@ -126,11 +126,13 @@ def test_get_result(self):
last_announce = datetime.utcnow() - last_announce

future_time = config["start"] + 30
process_memory = memory.process_memory()
total_consumption = memory.total_consumption()
expected_data = {
"state": config["state"],
"agent_hostname": config["agent_hostname"],
"agent_process_ram": memory.process_memory(),
"consumed_ram": memory.total_consumption(),
"agent_process_ram": process_memory,
"consumed_ram": total_consumption,
"child_processes": direct_child_processes,
"grandchild_processes": grandchild_processes,
"pids": config["pids"],
Expand All @@ -148,7 +150,11 @@ def test_get_result(self):

with nested(
mock.patch.object(memory, "free_ram", return_value=4242),
mock.patch.object(time, "time", return_value=future_time)
mock.patch.object(time, "time", return_value=future_time),
mock.patch.object(
memory, "process_memory", return_value=process_memory),
mock.patch.object(
memory, "total_consumption", return_value=total_consumption)
):
response = status.render(request)

Expand All @@ -157,3 +163,4 @@ def test_get_result(self):
self.assertEqual(request.responseCode, OK)
self.assertEqual(len(request.written), 1)
self.assertEqual(loads(request.written[0]), expected_data)

0 comments on commit 9300723

Please sign in to comment.