diff options
author | Thomas Haller <thaller@redhat.com> | 2023-02-07 12:40:50 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-02-08 10:11:13 +0100 |
commit | ee17346cee3c116db5ebebd3f4e4fe81a58944b7 (patch) | |
tree | 60e3dc11a5e5833065e8cdd65078793d7336dddc | |
parent | debf78dbedbbe00acf34a2ba0f71a79fd130b407 (diff) | |
download | NetworkManager-ee17346cee3c116db5ebebd3f4e4fe81a58944b7.tar.gz |
test-client: cleanup imports
Sort imports by name. Also avoid "from signal import SIGINT". I find
it ugly to import names in the current namespace. "SIGINT" should be
refered to by its full name, including the package/namespace.
-rwxr-xr-x | src/tests/client/test-client.py | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index cb1bef6ae6..dd90947b76 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -98,26 +98,25 @@ ENV_LIBTOOL = "LIBTOOL" ############################################################################### -import sys - -import os +import collections +import dbus +import dbus.mainloop.glib +import dbus.service import errno -import unittest -import socket -import itertools -import subprocess -import shlex -import re import fcntl -import dbus -import time +import io +import itertools +import os import random +import re +import shlex +import signal +import socket +import subprocess +import sys import tempfile -import dbus.service -import dbus.mainloop.glib -import collections -import io -from signal import SIGINT +import time +import unittest import gi @@ -215,10 +214,10 @@ class Util: } @classmethod - def signal_no_to_str(cls, signal): - s = cls._signal_no_lookup.get(signal, None) + def signal_no_to_str(cls, sig): + s = cls._signal_no_lookup.get(sig, None) if s is None: - return "<unknown %d>" % (signal) + return "<unknown %d>" % (sig) return s @staticmethod @@ -2029,7 +2028,7 @@ class TestNmcli(unittest.TestCase): return nmc def end_mon(self, nmc): - nmc.pexp.kill(SIGINT) + nmc.pexp.kill(signal.SIGINT) nmc.pexp.expect(pexpect.EOF) Util.valgrind_check_log(nmc.valgrind_log, "test_monitor") |