about summary refs log tree commit diff
path: root/tst/test_check.py
diff options
context:
space:
mode:
Diffstat (limited to 'tst/test_check.py')
-rw-r--r--tst/test_check.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tst/test_check.py b/tst/test_check.py
index 397b9ca..f809a90 100644
--- a/tst/test_check.py
+++ b/tst/test_check.py
@@ -26,7 +26,7 @@ from hypothesis import given
 from pytest import mark
 from trustme import CA
 
-from scadere.check import base64_from_str, check
+from scadere.check import CtlChrTrans, base64_from_str, check
 from scadere.listen import parse_summary, str_from_base64
 
 SECONDS_AGO = datetime.now(tz=timezone.utc)
@@ -36,7 +36,8 @@ NEXT_WEEK = SECONDS_AGO + timedelta(days=7)
 
 @given(...)
 def test_base64(string: str):
-    assert str_from_base64(base64_from_str(string)) == string
+    printable_string = string.translate(CtlChrTrans())
+    assert str_from_base64(base64_from_str(string)) == printable_string
 
 
 async def noop(reader, writer):
@@ -84,10 +85,10 @@ async def test_check(domain, ca_name, not_after, after, trust_ca):
                                          ca if trust_ca else None)
         if not trust_ca:
             assert failed_to_get_cert(summary)
-            assert 'self-signed certificate' in summary[-1]
+            assert 'self-signed certificate' in str_from_base64(summary[-1])
         elif not_after == SECONDS_AGO:
             assert failed_to_get_cert(summary)
-            assert 'certificate has expired' in summary[-1]
+            assert 'certificate has expired' in str_from_base64(summary[-1])
         elif not_after > after:
             assert summary is None
         else: