tests: Validate **kwargs for TestProcess.wait_for.
This commit is contained in:
parent
9607fae935
commit
e9ece3d114
@ -127,6 +127,9 @@ class QuteProc(testprocess.Process):
|
||||
|
||||
got_error = pyqtSignal()
|
||||
|
||||
KEYS = ['timestamp', 'loglevel', 'category', 'module', 'function', 'line',
|
||||
'message']
|
||||
|
||||
def __init__(self, httpbin, parent=None):
|
||||
super().__init__(parent)
|
||||
self._httpbin = httpbin
|
||||
|
@ -79,6 +79,7 @@ class Process(QObject):
|
||||
|
||||
ready = pyqtSignal()
|
||||
new_data = pyqtSignal(object)
|
||||
KEYS = ['data']
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@ -234,6 +235,9 @@ class Process(QObject):
|
||||
timeout = 15000
|
||||
else:
|
||||
timeout = 5000
|
||||
for key in kwargs:
|
||||
assert key in self.KEYS
|
||||
|
||||
# Search existing messages
|
||||
for line in self._data:
|
||||
matches = []
|
||||
|
@ -67,6 +67,8 @@ class HTTPBin(testprocess.Process):
|
||||
\ (?P<size>[^ ]*)
|
||||
""", re.VERBOSE)
|
||||
|
||||
KEYS = ['verb', 'path']
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.port = self._get_port()
|
||||
|
Loading…
Reference in New Issue
Block a user