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