summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_reporting.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unittests/test_reporting.py b/tests/unittests/test_reporting.py
index 9f11fd5c..b78a6939 100644
--- a/tests/unittests/test_reporting.py
+++ b/tests/unittests/test_reporting.py
@@ -113,6 +113,7 @@ class TestReportingEvent(TestCase):
class TestFinishReportingEvent(TestCase):
+
def test_as_has_result(self):
result = events.status.SUCCESS
name, desc = 'test_name', 'test_desc'
@@ -121,6 +122,23 @@ class TestFinishReportingEvent(TestCase):
self.assertTrue('result' in ret)
self.assertEqual(ret['result'], result)
+ def test_has_result_with_optional_post_files(self):
+ result = events.status.SUCCESS
+ name, desc, files = 'test_name', 'test_desc', [
+ '/really/fake/path/install.log']
+ event = events.FinishReportingEvent(
+ name, desc, result, post_files=files)
+ ret = event.as_dict()
+ self.assertTrue('result' in ret)
+ self.assertTrue('files' in ret)
+ self.assertEqual(ret['result'], result)
+ posted_install_log = ret['files'][0]
+ self.assertTrue('path' in posted_install_log)
+ self.assertTrue('content' in posted_install_log)
+ self.assertTrue('encoding' in posted_install_log)
+ self.assertEqual(posted_install_log['path'], files[0])
+ self.assertEqual(posted_install_log['encoding'], 'base64')
+
class TestBaseReportingHandler(TestCase):