summaryrefslogtreecommitdiff
path: root/test/test_theming.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-10-31 19:15:57 +0100
committermathieui <mathieui@mathieui.net>2014-10-31 19:16:44 +0100
commit1c1ab3cb839e5509db52770e10c7190f844eb2e5 (patch)
treeb331060b3dc42651e61e4ccb2dfe6af5e2e97752 /test/test_theming.py
parentcedc5a6ec80a46437f42464415fd1806049c593d (diff)
parentea2b703bfd07d293ba9fdd85ac657275d43da2a7 (diff)
downloadpoezio-1c1ab3cb839e5509db52770e10c7190f844eb2e5.tar.gz
poezio-1c1ab3cb839e5509db52770e10c7190f844eb2e5.tar.bz2
poezio-1c1ab3cb839e5509db52770e10c7190f844eb2e5.tar.xz
poezio-1c1ab3cb839e5509db52770e10c7190f844eb2e5.zip
Merge branch 'master' of git.poez.io:poezio into slix
Conflicts: src/bookmark.py src/config.py src/connection.py src/core/commands.py src/core/core.py src/core/handlers.py src/windows/info_bar.py src/windows/muc.py src/windows/roster_win.py src/windows/text_win.py src/xhtml.py
Diffstat (limited to 'test/test_theming.py')
-rw-r--r--test/test_theming.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_theming.py b/test/test_theming.py
new file mode 100644
index 00000000..9cdb4829
--- /dev/null
+++ b/test/test_theming.py
@@ -0,0 +1,26 @@
+"""
+Test the functions in the `theming` module
+"""
+
+import sys
+import pytest
+sys.path.append('src')
+
+from theming import dump_tuple, read_tuple
+
+def test_read_tuple():
+ assert read_tuple('1,-1,u') == ((1, -1), 'u')
+ assert read_tuple('1,2') == ((1, 2), None)
+
+ with pytest.raises(IndexError):
+ read_tuple('1')
+
+ with pytest.raises(ValueError):
+ read_tuple('toto')
+
+def test_dump_tuple():
+ assert dump_tuple((1, 2)) == '1,2'
+ assert dump_tuple((1, )) == '1'
+ assert dump_tuple((1, 2, 'u')) == '1,2,u'
+
+