summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-21 15:39:46 +0200
committermathieui <mathieui@mathieui.net>2016-08-21 15:58:07 +0200
commit5f0c0fbb0adb45407008d84dc1b6e843cd94870c (patch)
tree4bf746e3fcc5b3abddb723b1ced620e4e3ac0682 /test
parent84e59b05ff0a17178da9ecdb6c5d084e48b42763 (diff)
downloadpoezio-5f0c0fbb0adb45407008d84dc1b6e843cd94870c.tar.gz
poezio-5f0c0fbb0adb45407008d84dc1b6e843cd94870c.tar.bz2
poezio-5f0c0fbb0adb45407008d84dc1b6e843cd94870c.tar.xz
poezio-5f0c0fbb0adb45407008d84dc1b6e843cd94870c.zip
Update tests
Diffstat (limited to 'test')
-rw-r--r--test/test_common.py15
-rw-r--r--test/test_completion.py7
-rw-r--r--test/test_config.py5
-rw-r--r--test/test_poopt.py4
-rw-r--r--test/test_theming.py4
-rw-r--r--test/test_windows.py8
-rw-r--r--test/test_xhtml.py4
7 files changed, 15 insertions, 32 deletions
diff --git a/test/test_common.py b/test/test_common.py
index dde49524..d7bc2b8b 100644
--- a/test/test_common.py
+++ b/test/test_common.py
@@ -2,19 +2,16 @@
Test the functions in the `common` module
"""
-import sys
-sys.path.append('poezio')
-
import time
import pytest
import datetime
from slixmpp import JID
from datetime import timedelta
-from common import (_datetime_tuple as datetime_tuple, get_utc_time,
- get_local_time, shell_split, _find_argument_quoted
- as find_argument_quoted, _find_argument_unquoted as
- find_argument_unquoted, parse_str_to_secs,
- parse_secs_to_str, safeJID)
+from poezio.common import (_datetime_tuple as datetime_tuple, get_utc_time,
+ get_local_time, shell_split, _find_argument_quoted
+ as find_argument_quoted, _find_argument_unquoted as
+ find_argument_unquoted, parse_str_to_secs,
+ parse_secs_to_str, safeJID)
def test_utc_time():
delta = timedelta(seconds=-3600)
@@ -65,4 +62,4 @@ def test_parse_secs_to_str():
def test_safeJID():
assert safeJID('toto@titi/tata') == JID('toto@titi/tata')
- assert safeJID('é_è') == JID('')
+ assert safeJID('toto@…') == JID('')
diff --git a/test/test_completion.py b/test/test_completion.py
index 54c0f057..c731e807 100644
--- a/test/test_completion.py
+++ b/test/test_completion.py
@@ -5,19 +5,16 @@ Test the completions methods on an altered input object.
import string
import pytest
import random
-import sys
import os
-sys.path.append('poezio')
-
class ConfigShim(object):
def get(self, *args, **kwargs):
return ''
-import config
+from poezio import config
config.config = ConfigShim()
-from windows import Input
+from poezio.windows import Input
@pytest.fixture(scope="function")
def input_obj():
diff --git a/test/test_config.py b/test/test_config.py
index 4c87458e..d2f952de 100644
--- a/test/test_config.py
+++ b/test/test_config.py
@@ -4,13 +4,10 @@ Test the config module
import tempfile
import pytest
-import sys
import os
-sys.path.append('poezio')
-
-import config
+from poezio import config
@pytest.yield_fixture(scope="module")
def config_obj():
diff --git a/test/test_poopt.py b/test/test_poopt.py
index 54f466a6..cdf8d041 100644
--- a/test/test_poopt.py
+++ b/test/test_poopt.py
@@ -3,10 +3,8 @@ Test of the poopt module
"""
import pytest
-import sys
-sys.path.append('poezio')
-from poopt import cut_text
+from poezio.poopt import cut_text
def test_cut_text():
diff --git a/test/test_theming.py b/test/test_theming.py
index 40d1ab42..08856571 100644
--- a/test/test_theming.py
+++ b/test/test_theming.py
@@ -2,11 +2,9 @@
Test the functions in the `theming` module
"""
-import sys
import pytest
-sys.path.append('poezio')
-from theming import dump_tuple, read_tuple
+from poezio.theming import dump_tuple, read_tuple
def test_read_tuple():
assert read_tuple('1,-1,u') == ((1, -1), 'u')
diff --git a/test/test_windows.py b/test/test_windows.py
index 26a426c7..8623342b 100644
--- a/test/test_windows.py
+++ b/test/test_windows.py
@@ -1,16 +1,14 @@
import pytest
-import sys
-sys.path.append('poezio')
class ConfigShim(object):
def get(self, *args, **kwargs):
return ''
-import config
+from poezio import config
config.config = ConfigShim()
-import core
+from poezio import core
-from windows import Input, HistoryInput, MessageInput, CommandInput
+from poezio.windows import Input, HistoryInput, MessageInput, CommandInput
@pytest.fixture
def input():
diff --git a/test/test_xhtml.py b/test/test_xhtml.py
index b4d6c3da..ad72513a 100644
--- a/test/test_xhtml.py
+++ b/test/test_xhtml.py
@@ -3,11 +3,9 @@ Test the functions in the `xhtml` module
"""
import pytest
-import sys
import xml
-sys.path.append('poezio')
-from xhtml import (poezio_colors_to_html, xhtml_to_poezio_colors,
+from poezio.xhtml import (poezio_colors_to_html, xhtml_to_poezio_colors,
parse_css, clean_text)
def test_clean_text():