Commit 5f0c0fbb authored by mathieui's avatar mathieui

Update tests

parent 84e59b05
language: python
python:
- "3.4"
- "3.5"
install:
- pip install -r requirements.txt
- python setup.py build_ext --inplace
- python setup.py install
script: make test
......@@ -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('')
......@@ -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():
......
......@@ -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():
......
......@@ -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():
......
......@@ -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')
......
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():
......
......@@ -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():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment