return None
return tuple(line.split(' ', maxsplit=1))
- def check_start_for_config(self) -> Optional[Path]:
- 'While on first line, if config file identified, inc idx, return path.'
- assert self._idx == 0
- if self._lines[self._idx].startswith('#config '):
- _, toml_name = self._lines[0].split(maxsplit=1)
- self._idx += 1
- return PATH_TESTS.joinpath(toml_name)
- return None
-
class TestingClientTui(ClientTui):
'Collects keypresses via TestTerminal and test file, compares log results.'
_client_cls = _TestClientKnowingTui
_clients: list[_TestClientKnowingTui]
+ _path_config: Optional[Path] = None
_path_logs = None
_path_test: Path
def __init__(self, **kwargs) -> None:
+ fname_config = self._path_test.stem + '.toml'
+ path_config = PATH_TESTS.joinpath(fname_config)
+ if path_config.exists():
+ assert path_config.is_file()
+ self._path_config = path_config
self._clients = []
self._playbook = _Playbook(path=self._path_test,
get_client=lambda idx: self._clients[idx])
- self._path_config = self._playbook.check_start_for_config()
super().__init__(**kwargs)
assert isinstance(self._term, TestTerminal)
self._playbook.put_keypress = self._term._q_keypresses.put
-#config test.toml
-0 # Found config at tests/test.toml, reading …
+0 # Found config at tests/config.toml, reading …
0 # Connecting: {'hostname': 'irc.test0.net', 'nickname': 'foo', 'password': 'bar', 'username': 'baz', 'realname': 'quux', 'port': 1234, 'channels': ['#test', '##testtest']}
1 $ isupport cleared
1 $ isupport:CHANTYPES set to: [#&]