1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-24 07:08:53 +02:00

add helper functions for python3 support

This functions are used in the whole code and are
mandatory for the python3 support to work. In python2
case nothing is touched.

* cmp_to_key:
  converts a cmp= into a key= function

* decode_list:
  decodes each element of a list. This is needed if
  we have a mixed list with strings and bytes.

* decode_it:
  Takes the input and checks if it is not a string.
  Then it uses chardet to get the encoding.
This commit is contained in:
lethliel
2018-11-07 15:03:43 +01:00
parent aa88b6b795
commit 4b29e1c543
3 changed files with 102 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import test_setlinkrev
import test_prdiff
import test_conf
import test_results
import test_helpers
suite = unittest.TestSuite()
suite.addTests(test_addfiles.suite())
@@ -42,6 +43,7 @@ suite.addTests(test_setlinkrev.suite())
suite.addTests(test_prdiff.suite())
suite.addTests(test_conf.suite())
suite.addTests(test_results.suite())
suite.addTests(test_helpers.suite())
if have_xmlrunner:
result = xmlrunner.XMLTestRunner(output=os.path.join(os.getcwd(), 'junit-xml-results')).run(suite)