From 0d1fbcee887b9bd635e07dc807d64eba0b9905d4 Mon Sep 17 00:00:00 2001 From: Mike Terzo Date: Mon, 23 Jan 2017 06:30:23 -0500 Subject: [PATCH] Adding tests for node list Signed-off-by: Mike Terzo --- test/test_app.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/test_app.py b/test/test_app.py index db5ab10..4eb7964 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -38,14 +38,34 @@ def mock_puppetdb_environments(mocker): @pytest.fixture def mock_puppetdb_default_nodes(mocker): node_list = [ - Node('_', 'node', + Node('_', 'node-unreported', report_timestamp='2013-08-01T09:57:00.000Z', latest_report_hash='1234567', catalog_timestamp='2013-08-01T09:57:00.000Z', - facts_timestamp='2013-08-01T09:57:00.000Z',) + facts_timestamp='2013-08-01T09:57:00.000Z', + status='unreported'), + Node('_', 'node-changed', + report_timestamp='2013-08-01T09:57:00.000Z', + latest_report_hash='1234567', + catalog_timestamp='2013-08-01T09:57:00.000Z', + facts_timestamp='2013-08-01T09:57:00.000Z', + status='changed'), + Node('_', 'node-failed', + report_timestamp='2013-08-01T09:57:00.000Z', + latest_report_hash='1234567', + catalog_timestamp='2013-08-01T09:57:00.000Z', + facts_timestamp='2013-08-01T09:57:00.000Z', + status='failed'), + Node('_', 'node-noop', + report_timestamp='2013-08-01T09:57:00.000Z', + latest_report_hash='1234567', + catalog_timestamp='2013-08-01T09:57:00.000Z', + facts_timestamp='2013-08-01T09:57:00.000Z', + status='noop') + ] return mocker.patch.object(app.puppetdb, 'nodes', - return_value=node_list) + return_value=iter(node_list)) @pytest.fixture