aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/jenkins.sh4
-rw-r--r--[-rwxr-xr-x]pySim/tests/test_utils.py (renamed from tests/test_utils.py)5
-rw-r--r--pySim/transport/__init__.py9
-rw-r--r--setup.py4
4 files changed, 11 insertions, 11 deletions
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 27f0245..82cb6d9 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -24,9 +24,11 @@ pip install jsonpath-ng
pip install construct
pip install bidict
pip install gsm0338
+pip install nose
# Execute automatically discovered unit tests first
-python -m unittest discover -v -s tests/
+# - cannot use "python -m ./setup.py test" here as that somehow doesn't work in venv
+nosetests
# Run pylint to find potential errors
# Ignore E1102: not-callable
diff --git a/tests/test_utils.py b/pySim/tests/test_utils.py
index ed22eff..2fac57b 100755..100644
--- a/tests/test_utils.py
+++ b/pySim/tests/test_utils.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
import unittest
from pySim import utils
from pySim.ts_31_102 import EF_SUCI_Calc_Info
@@ -201,6 +199,3 @@ class TestComprTlv(unittest.TestCase):
self.assertEqual(res, b'\x7f\x12\x34')
res = utils.comprehensiontlv_encode_tag({'tag': 0x1234, 'comprehension':True})
self.assertEqual(res, b'\x7f\x92\x34')
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index dae2a78..73f9486 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -217,19 +217,20 @@ def init_reader(opts, **kwargs) -> Optional[LinkBase]:
sl = None # type : :Optional[LinkBase]
try:
if opts.pcsc_dev is not None:
- print("Using PC/SC reader interface")
+ print("Using PC/SC reader interface (dev_number=%u)" % opts.pcsc_dev)
from pySim.transport.pcsc import PcscSimLink
sl = PcscSimLink(opts.pcsc_dev, **kwargs)
elif opts.osmocon_sock is not None:
- print("Using Calypso-based (OsmocomBB) reader interface")
+ print("Using Calypso-based (OsmocomBB) reader interface (sock='%s')" % opts.osmocon_sock)
from pySim.transport.calypso import CalypsoSimLink
sl = CalypsoSimLink(sock_path=opts.osmocon_sock, **kwargs)
elif opts.modem_dev is not None:
- print("Using modem for Generic SIM Access (3GPP TS 27.007)")
+ print("Using modem for Generic SIM Access (3GPP TS 27.007) (dev='%s', baud=%u)" %
+ (opts.modem_dev, opts.modem_baud))
from pySim.transport.modem_atcmd import ModemATCommandLink
sl = ModemATCommandLink(device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
else: # Serial reader is default
- print("Using serial reader interface")
+ print("Using serial reader interface (dev='%s', baud=%u)" % (opts.device, opts.baudrate))
from pySim.transport.serial import SerialSimLink
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate, **kwargs)
return sl
diff --git a/setup.py b/setup.py
index 2ef498f..37129b8 100644
--- a/setup.py
+++ b/setup.py
@@ -22,5 +22,7 @@ setup(
'pySim-prog.py',
'pySim-read.py',
'pySim-shell.py'
- ]
+ ],
+ test_suite='nose.collector',
+ tests_require=['nose'],
)