Module: check_mk
Branch: master
Commit: d92cdc0775c1969950dec31daa74cddb6f1ae79b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d92cdc0775c196…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 12 07:48:12 2019 +0100
Add some simple tests
Change-Id: I2ca4aaa01d989ec9e7adcb7e2aea6df2f4cb063e
---
tests/unit/cmk/ec/test_scrub_and_decode.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/unit/cmk/ec/test_scrub_and_decode.py
b/tests/unit/cmk/ec/test_scrub_and_decode.py
new file mode 100644
index 0000000..4a59739
--- /dev/null
+++ b/tests/unit/cmk/ec/test_scrub_and_decode.py
@@ -0,0 +1,13 @@
+# encoding: utf-8
+
+import cmk.ec.main as main
+
+
+def test_scrub_and_decode():
+ result = main.scrub_and_decode("0123bla\nbla\tbla\0blub\1buh\2boh\3")
+ assert result == "0123blabla blablubbuhboh\3"
+ assert isinstance(result, unicode)
+
+ result = main.scrub_and_decode(u"0123bla\nbla\tbla\0blub\1buh\2boh\3")
+ assert result == u"0123blabla blablubbuhboh\3"
+ assert isinstance(result, unicode)