You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.8 KiB

From 826d887e8c76654e16dab2249b6035b748bdfeeb Mon Sep 17 00:00:00 2001
From: Christian Kellner <christian@kellner.me>
Date: Wed, 6 Jun 2018 20:12:26 +0200
Subject: [PATCH] test: integration: py2 compatibility
The integration test was designed to run with python3, but we it
can be made to work with python2 quite easily so do that.
---
tests/test-integration | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/test-integration b/tests/test-integration
index 40c917d..f24900a 100755
--- a/tests/test-integration
+++ b/tests/test-integration
@@ -1,4 +1,5 @@
#!/usr/bin/python3
+# -*- coding: utf-8 -*-
#
# bolt integration test suite
#
@@ -19,6 +20,8 @@
# Authors:
# Christian J. Kellner <christian@kellner.me>
+from __future__ import print_function
+
import binascii
import os
import shutil
--
2.17.1
From d8e8920806a9d1afa691e4d5e7f16c67806d110c Mon Sep 17 00:00:00 2001
From: Christian Kellner <christian@kellner.me>
Date: Wed, 6 Jun 2018 20:20:02 +0200
Subject: [PATCH] test: integration: import configparser globally
Instead of importing it twice locally in two functions, import it
globally; do so in the checked block because it is not installed
by default and thus might be missing.
---
tests/test-integration | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-integration b/tests/test-integration
index f24900a..d2fd7df 100755
--- a/tests/test-integration
+++ b/tests/test-integration
@@ -45,6 +45,8 @@ try:
import dbus
import dbusmock
+
+ import configparser
except ImportError as e:
sys.stderr.write('Skipping integration test due to missing depdendencies: %s\n' % str(e))
sys.exit(1)
@@ -924,7 +926,6 @@ class BoltTest(dbusmock.DBusTestCase):
self.polkitd = None
def user_config(self, **kwargs):
- import configparser
cfg = configparser.ConfigParser()
cfg.optionxform = lambda option: option
@@ -1017,7 +1018,6 @@ class BoltTest(dbusmock.DBusTestCase):
return x[0]
def store_device(self, dev, policy='auto', key=None):
- import configparser
df = configparser.ConfigParser()
df.optionxform = lambda option: option
--
2.17.1
From 4ada3a5ce4aa4cfe7e3f0a066c2b9be7281f8930 Mon Sep 17 00:00:00 2001
From: Christian Kellner <christian@kellner.me>
Date: Wed, 6 Jun 2018 20:34:56 +0200
Subject: [PATCH] test: integration: use default python
Instead of explicitly specifying the python version, use the
default, i.e. /usr/bin/python
---
tests/test-integration | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-integration b/tests/test-integration
index d2fd7df..66fb89f 100755
--- a/tests/test-integration
+++ b/tests/test-integration
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# bolt integration test suite
--
2.17.1