summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-07-04 12:41:50 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-07-04 15:45:15 +0200
commit1e2c17a35057abf81395b381e290ccb07c09bb38 (patch)
tree52921743f9dc8be953654dfcb37db230859314c9
parentb7bcc716fc4819c52ec0ff02cf4e8c0fda622930 (diff)
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>
-rw-r--r--pyuno/Module_pyuno.mk1
-rw-r--r--pyuno/PythonTest_pyuno_pytests_testbz2.mk16
-rw-r--r--pyuno/qa/pytests/testbz2.py14
3 files changed, 31 insertions, 0 deletions
diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk
index 890b9fc4aa9e..fac159e2ced3 100644
--- a/pyuno/Module_pyuno.mk
+++ b/pyuno/Module_pyuno.mk
@@ -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, \
diff --git a/pyuno/PythonTest_pyuno_pytests_testbz2.mk b/pyuno/PythonTest_pyuno_pytests_testbz2.mk
new file mode 100644
index 000000000000..0f881068c541
--- /dev/null
+++ b/pyuno/PythonTest_pyuno_pytests_testbz2.mk
@@ -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:
diff --git a/pyuno/qa/pytests/testbz2.py b/pyuno/qa/pytests/testbz2.py
new file mode 100644
index 000000000000..12a44e14bb09
--- /dev/null
+++ b/pyuno/qa/pytests/testbz2.py
@@ -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()