summaryrefslogtreecommitdiff
path: root/tests/unittests/test_reporting.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_reporting.py')
-rw-r--r--tests/unittests/test_reporting.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/unittests/test_reporting.py b/tests/unittests/test_reporting.py
index 0a441adf..32356ef9 100644
--- a/tests/unittests/test_reporting.py
+++ b/tests/unittests/test_reporting.py
@@ -100,9 +100,15 @@ class TestReportingEvent(TestCase):
def test_as_dict(self):
event_type, name, desc = 'test_type', 'test_name', 'test_desc'
event = events.ReportingEvent(event_type, name, desc)
- self.assertEqual(
- {'event_type': event_type, 'name': name, 'description': desc},
- event.as_dict())
+ expected = {'event_type': event_type, 'name': name,
+ 'description': desc, 'origin': 'cloudinit'}
+
+ # allow for timestamp to differ, but must be present
+ as_dict = event.as_dict()
+ self.assertIn('timestamp', as_dict)
+ del as_dict['timestamp']
+
+ self.assertEqual(expected, as_dict)
class TestFinishReportingEvent(TestCase):