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:53:05 +0100 |
| commit | 0694ecfcc5de953571af0fb8e85e7d028ba16308 (patch) | |
| tree | 909baf6844254177d7985f659b3e2247aabf3523 /src/tests | |
| parent | ba5cbedd2ca4315313b966a4fdf8b38bd3277475 (diff) | |
| download | NetworkManager-0694ecfcc5de953571af0fb8e85e7d028ba16308.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.
(cherry picked from commit ee17346cee3c116db5ebebd3f4e4fe81a58944b7)
Diffstat (limited to 'src/tests')
| -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") |
