Update tests
This commit is contained in:
parent
84e59b05ff
commit
5f0c0fbb0a
8 changed files with 18 additions and 33 deletions
|
@ -1,7 +1,9 @@
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.4"
|
- "3.5"
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- python setup.py build_ext --inplace
|
- python setup.py build_ext --inplace
|
||||||
|
- python setup.py install
|
||||||
script: make test
|
script: make test
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,16 @@
|
||||||
Test the functions in the `common` module
|
Test the functions in the `common` module
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
sys.path.append('poezio')
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import pytest
|
import pytest
|
||||||
import datetime
|
import datetime
|
||||||
from slixmpp import JID
|
from slixmpp import JID
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from common import (_datetime_tuple as datetime_tuple, get_utc_time,
|
from poezio.common import (_datetime_tuple as datetime_tuple, get_utc_time,
|
||||||
get_local_time, shell_split, _find_argument_quoted
|
get_local_time, shell_split, _find_argument_quoted
|
||||||
as find_argument_quoted, _find_argument_unquoted as
|
as find_argument_quoted, _find_argument_unquoted as
|
||||||
find_argument_unquoted, parse_str_to_secs,
|
find_argument_unquoted, parse_str_to_secs,
|
||||||
parse_secs_to_str, safeJID)
|
parse_secs_to_str, safeJID)
|
||||||
|
|
||||||
def test_utc_time():
|
def test_utc_time():
|
||||||
delta = timedelta(seconds=-3600)
|
delta = timedelta(seconds=-3600)
|
||||||
|
@ -65,4 +62,4 @@ def test_parse_secs_to_str():
|
||||||
|
|
||||||
def test_safeJID():
|
def test_safeJID():
|
||||||
assert safeJID('toto@titi/tata') == JID('toto@titi/tata')
|
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 string
|
||||||
import pytest
|
import pytest
|
||||||
import random
|
import random
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
sys.path.append('poezio')
|
|
||||||
|
|
||||||
class ConfigShim(object):
|
class ConfigShim(object):
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
import config
|
from poezio import config
|
||||||
config.config = ConfigShim()
|
config.config = ConfigShim()
|
||||||
|
|
||||||
from windows import Input
|
from poezio.windows import Input
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
def input_obj():
|
def input_obj():
|
||||||
|
|
|
@ -4,13 +4,10 @@ Test the config module
|
||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
sys.path.append('poezio')
|
from poezio import config
|
||||||
|
|
||||||
import config
|
|
||||||
|
|
||||||
@pytest.yield_fixture(scope="module")
|
@pytest.yield_fixture(scope="module")
|
||||||
def config_obj():
|
def config_obj():
|
||||||
|
|
|
@ -3,10 +3,8 @@ Test of the poopt module
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
|
||||||
sys.path.append('poezio')
|
|
||||||
|
|
||||||
from poopt import cut_text
|
from poezio.poopt import cut_text
|
||||||
|
|
||||||
def test_cut_text():
|
def test_cut_text():
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
Test the functions in the `theming` module
|
Test the functions in the `theming` module
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
import pytest
|
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():
|
def test_read_tuple():
|
||||||
assert read_tuple('1,-1,u') == ((1, -1), 'u')
|
assert read_tuple('1,-1,u') == ((1, -1), 'u')
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
|
||||||
sys.path.append('poezio')
|
|
||||||
|
|
||||||
class ConfigShim(object):
|
class ConfigShim(object):
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
import config
|
from poezio import config
|
||||||
config.config = ConfigShim()
|
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
|
@pytest.fixture
|
||||||
def input():
|
def input():
|
||||||
|
|
|
@ -3,11 +3,9 @@ Test the functions in the `xhtml` module
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import sys
|
|
||||||
import xml
|
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)
|
parse_css, clean_text)
|
||||||
|
|
||||||
def test_clean_text():
|
def test_clean_text():
|
||||||
|
|
Loading…
Reference in a new issue