fix: keep notification credentials out of process arguments
This commit is contained in:
1 parent
6daabae415
commit
64d9138a8f
2 files changed
+37
-2
No files matched your search
+17
-1
@@ -1,6 +1,8 @@
|
||||
# tests/test_notify.py
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
from engine.lib.notify import build_text
|
||||
from engine.lib.notify import build_text, resolve_bot_url
|
||||
|
||||
class TestNotify(unittest.TestCase):
|
||||
def test_instance_is_the_host(self):
|
||||
@@ -20,5 +22,19 @@ class TestNotify(unittest.TestCase):
|
||||
self.assertIn("Resolved", t)
|
||||
self.assertIn("✅", t)
|
||||
|
||||
def test_literal_bot_url_is_unchanged(self):
|
||||
self.assertEqual(resolve_bot_url("https://example.test/bot"),
|
||||
"https://example.test/bot")
|
||||
|
||||
def test_bot_url_file_reference(self):
|
||||
fd, path = tempfile.mkstemp()
|
||||
try:
|
||||
with os.fdopen(fd, "w") as f:
|
||||
f.write("https://example.test/secret\n")
|
||||
self.assertEqual(resolve_bot_url("@" + path),
|
||||
"https://example.test/secret")
|
||||
finally:
|
||||
os.unlink(path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user