Skip to content

Commit

Permalink
test: drop dependency on init_journal
Browse files Browse the repository at this point in the history
pipe patchsets into append_journal to accomplish the same functionality

Signed-off-by: Joel Savitz <[email protected]>
  • Loading branch information
theyoyojo committed Feb 21, 2025
1 parent 68f8e66 commit 926377b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/general_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
from pathlib import Path
from diameter import run_shell_command, RocketCrew, RocketRadio, SINGULARITY_HOSTNAME, DOCKER_COMPOSE, DOCKER, CERT_PATH

# The RocketCrew pilots the rocket into orbit
crew = RocketCrew()


def setup_module():
"""Setup before any tests run."""
run_shell_command("flake8")
run_shell_command("./script-lint.sh")
os.makedirs("test/artifacts", exist_ok=True)
for file in Path("artifacts").glob("*"):
for file in Path("test/artifacts").glob("*"):
file.unlink()
run_shell_command(f'{DOCKER} cp singularity_nginx_1:/etc/ssl/nginx/fullchain.pem {CERT_PATH}')


# The RocketCrew pilots the rocket into orbit
crew = RocketCrew()


def test_registration_fails_before_user_creation():
assert "msg = no such student" in crew.pilot('/register', data={"student_id": "1234"}).text

Expand Down Expand Up @@ -88,7 +89,7 @@ def test_email_empty_list_before_journal_update():
def test_restricted_user_cannot_access_messages():
run_shell_command("orbit/warpdrive.sh -u resu -p ssap -n")
run_shell_command(f'{DOCKER_COMPOSE} exec denis /usr/local/bin/restrict_access /var/lib/email/journal/journal -d resu')
run_shell_command(f'{DOCKER_COMPOSE} exec denis /usr/local/bin/init_journal /var/lib/email/journal/journal /var/lib/email/journal/temp /var/lib/email/mail')
run_shell_command(f'{DOCKER_COMPOSE} exec denis sh -c "cat /var/lib/email/patchsets/* | append_journal /var/lib/email/journal/journal"')

mailbox = RocketRadio('resu', 'ssap', recv=True).pop

Expand Down

0 comments on commit 926377b

Please sign in to comment.