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.
This commit is contained in:
Thomas Haller 2023-02-07 12:40:50 +01:00
parent debf78dbed
commit ee17346cee
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -98,26 +98,25 @@ ENV_LIBTOOL = "LIBTOOL"
###############################################################################
import sys
import os
import errno
import unittest
import socket
import itertools
import subprocess
import shlex
import re
import fcntl
import dbus
import time
import random
import tempfile
import dbus.service
import dbus.mainloop.glib
import collections
import dbus
import dbus.mainloop.glib
import dbus.service
import errno
import fcntl
import io
from signal import SIGINT
import itertools
import os
import random
import re
import shlex
import signal
import socket
import subprocess
import sys
import tempfile
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")