aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cli.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 89da6b0..3638edd 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -458,6 +458,28 @@ class ReportCommand(unittest.TestCase):
self.assertEqual(written["destinations"], [])
self.assertEqual(written["unreportable"], [])
+ def test_no_configured_destination_warns_and_still_exits_zero(self):
+ self._write_config('[reporter]\nemail = "r@example.org"\n')
+ case_path = self._make_case()
+ code, _, err = self._run(
+ "--config", str(self.config), "report", str(case_path)
+ )
+ self.assertEqual(code, 0)
+ self.assertIn("no reporting destinations", err)
+ self.assertIn(str(self.config), err)
+
+ def test_a_configured_destination_produces_no_warning(self):
+ self._write_config(
+ '[reporter]\nemail = "r@example.org"\n'
+ '\n[abusedb]\napi_key = "k"\n'
+ )
+ case_path = self._make_case()
+ code, _, err = self._run(
+ "--config", str(self.config), "report", str(case_path)
+ )
+ self.assertEqual(code, 0)
+ self.assertNotIn("no reporting destinations", err)
+
if __name__ == "__main__":
unittest.main()