From 3185ae124d5e2240c220009fb35e3c8b6b06b01b Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Thu, 23 Jan 2020 18:34:53 +0100 Subject: [PATCH] Fixes paths on cli tests --- test/apps/cli/unit/test_pisa_cli.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/apps/cli/unit/test_pisa_cli.py b/test/apps/cli/unit/test_pisa_cli.py index 4927c7a..0ce40c6 100644 --- a/test/apps/cli/unit/test_pisa_cli.py +++ b/test/apps/cli/unit/test_pisa_cli.py @@ -154,12 +154,13 @@ def test_load_key_file_data(): def test_save_signed_appointment(monkeypatch): - monkeypatch.setattr(pisa_cli, "APPOINTMENTS_FOLDER_NAME", "test_appointments") + appointments_folder = "test_appointments_receipts" + pisa_cli.config["APPOINTMENTS_FOLDER_NAME"] = appointments_folder pisa_cli.save_signed_appointment(dummy_appointment.to_dict(), get_dummy_signature()) # In folder "Appointments," grab all files and print them. - files = os.listdir("test_appointments") + files = os.listdir(appointments_folder) found = False for f in files: @@ -169,10 +170,10 @@ def test_save_signed_appointment(monkeypatch): assert found # If "appointments" directory doesn't exist, function should create it. - assert os.path.exists("test_appointments") + assert os.path.exists(appointments_folder) # Delete test directory once we're done. - shutil.rmtree("test_appointments") + shutil.rmtree(appointments_folder) def test_parse_add_appointment_args():