diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2019-01-15 15:52:37 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2019-01-15 15:52:37 +0100 |
commit | 8d67c0f80aab724d67a1b6efb8af16aa71631a84 (patch) | |
tree | 4b49a7caa97f395502f16fcd790fdee48e7a688d /unittest/test_offline.py | |
parent | 1f3da5c76acb20b2183ac52373ed3b0b63e1151e (diff) | |
parent | a20bf2b343e8e30e8b3f377da210c67027a9ecf3 (diff) | |
download | libnitrokey-8d67c0f80aab724d67a1b6efb8af16aa71631a84.tar.gz libnitrokey-8d67c0f80aab724d67a1b6efb8af16aa71631a84.tar.bz2 |
Merge branch '144-python_multiline'
Add Python support for multiline declarations in NK_C_API.h
Add test for reading a structure, which uses multiline declaration
Add offline test for Python
CI: execute offline test for Python (GCC5 build only)
Fixes #144
Diffstat (limited to 'unittest/test_offline.py')
-rw-r--r-- | unittest/test_offline.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/unittest/test_offline.py b/unittest/test_offline.py new file mode 100644 index 0000000..51fe67d --- /dev/null +++ b/unittest/test_offline.py @@ -0,0 +1,39 @@ +""" +Copyright (c) 2019 Nitrokey UG + +This file is part of libnitrokey. + +libnitrokey is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +any later version. + +libnitrokey is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with libnitrokey. If not, see <http://www.gnu.org/licenses/>. + +SPDX-License-Identifier: LGPL-3.0 +""" + +from misc import gs +import re + + +def test_offline(C_offline): + C_offline.NK_set_debug(False) + C_offline.NK_set_debug_level(4) + assert C_offline.NK_get_major_library_version() == 3 + assert C_offline.NK_get_minor_library_version() >= 3 + assert C_offline.NK_login_auto() == 0 + + libnk_version = gs(C_offline.NK_get_library_version()) + assert libnk_version + print(libnk_version) + + # v3.4.1-29-g1f3d + search = re.search(b'v\d\.\d(\.\d)?', libnk_version) + assert search is not None
\ No newline at end of file |