* add full integration test of cli / pytest_abra with all tests * save path of runner_*.py in runner subclass to improve test discovery -> allows for same test name in two different runners * reorganize output dir names * use URL fixture everywhere * rework coordinator interface * add --session_id to cli args * add log results table * plenty of refactoring * add assert messages * add plenty of tests * add /docs dir with plenty of documentation * fix authentik setup * add authentik cleanup, remove test user * add random test user credential generation and integrate into test routine. random creds are saved to STATES Reviewed-on: local-it-infrastructure/e2e_tests#16 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
30 lines
No EOL
791 B
Python
30 lines
No EOL
791 B
Python
|
|
import time
|
|
import pytest
|
|
from pytest_abra.dir_manager import DirManager
|
|
from pathlib import Path
|
|
|
|
def test_get_latest_session_id_from_non_existing_dir(tmp_path: Path):
|
|
out = DirManager.get_latest_session_id(tmp_path / "not_exist")
|
|
assert out is None
|
|
|
|
def test_get_latest_session_id_from_empty_dir(tmp_path: Path):
|
|
out = DirManager.get_latest_session_id(tmp_path)
|
|
assert out is None
|
|
|
|
def test_get_latest_session_id_single(tmp_path: Path):
|
|
(tmp_path / "a").mkdir()
|
|
out = DirManager.get_latest_session_id(tmp_path)
|
|
assert out == "a"
|
|
|
|
|
|
|
|
@pytest.mark.slow
|
|
def test_get_latest_session_id(tmp_path: Path):
|
|
(tmp_path / "a").mkdir()
|
|
time.sleep(1.1)
|
|
(tmp_path / "b").mkdir()
|
|
out = DirManager.get_latest_session_id(tmp_path)
|
|
assert out == "b"
|
|
|
|
|