tdf#116412: Add unittest
Change-Id: Iab051c91900768a3bf3f26b6de3b443dc18a6928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169990 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
b7bcc716fc
commit
1e2c17a350
3 changed files with 31 additions and 0 deletions
|
@ -48,6 +48,7 @@ endif # SYSTEM_PYTHON
|
|||
|
||||
$(eval $(call gb_Module_add_check_targets,pyuno, \
|
||||
PythonTest_pyuno_pytests_testssl \
|
||||
PythonTest_pyuno_pytests_testbz2 \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \
|
||||
|
|
16
pyuno/PythonTest_pyuno_pytests_testbz2.mk
Normal file
16
pyuno/PythonTest_pyuno_pytests_testbz2.mk
Normal file
|
@ -0,0 +1,16 @@
|
|||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testbz2))
|
||||
|
||||
$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testbz2,$(SRCDIR)/pyuno/qa/pytests,\
|
||||
testbz2 \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
14
pyuno/qa/pytests/testbz2.py
Normal file
14
pyuno/qa/pytests/testbz2.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import os
|
||||
import unittest
|
||||
|
||||
# tdf#116412: make sure importing bz2 works on all platforms
|
||||
class BZ2Test(unittest.TestCase):
|
||||
def test_bz2_import(self):
|
||||
import bz2
|
||||
|
||||
# use imported bz2 module for pyflakes
|
||||
with open(os.devnull, "w") as devnull:
|
||||
print(str(bz2), file=devnull)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in a new issue