Skip to content

Commit

Permalink
fix test expectations for test_system_data
Browse files Browse the repository at this point in the history
  • Loading branch information
opalmer committed Aug 28, 2015
1 parent f70b5e2 commit 66d2bd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_agent/test_service.py
Expand Up @@ -90,11 +90,12 @@ def render_POST(self, request):

class TestSystemData(TestCase):
def test_system_data(self):
disk_data = [{"free": 50000, "mountpoint": "/", 'size': 100000}]
config["remote_ip"] = os.urandom(16).encode("hex")
expected = {
"id": config["agent_id"],
"current_assignments": {},
"disks": [{"free": 50000, "mountpoint": "/", 'size': 100000}],
"disks": disk_data,
"hostname": config["agent_hostname"],
"version": config.version,
"ram": config["agent_ram"],
Expand All @@ -111,7 +112,10 @@ def test_system_data(self):
}

agent = Agent()
with patch.object(graphics, "graphics_cards", return_value=[1, 3, 5]):
with nested(
patch.object(graphics, "graphics_cards", return_value=[1, 3, 5]),
patch.object(disks, "disks", return_value=disk_data)
):
system_data = agent.system_data()

self.assertApproximates(
Expand Down

0 comments on commit 66d2bd3

Please sign in to comment.