Adding tests for node list

Signed-off-by: Mike Terzo <mike@terzo.org>
This commit is contained in:
Mike Terzo
2017-01-23 06:30:23 -05:00
parent 7cebe56fc4
commit 0d1fbcee88

View File

@@ -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