From d7e91d34e738570e763eff0cce6268ec23a4be1f Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 20 Jan 2020 16:40:58 +0100 Subject: [PATCH] Updates cli test to expect an exception instead of False --- test/apps/cli/unit/test_pisa_cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/apps/cli/unit/test_pisa_cli.py b/test/apps/cli/unit/test_pisa_cli.py index b6b0219..bed98f5 100644 --- a/test/apps/cli/unit/test_pisa_cli.py +++ b/test/apps/cli/unit/test_pisa_cli.py @@ -1,3 +1,4 @@ +import pytest import responses import json import os @@ -150,8 +151,8 @@ def test_load_key_file_data(): os.remove("key_test_file") # If file doesn't exist, function should fail. - appt_data = pisa_cli.load_key_file_data("nonexistent_file") - assert not appt_data + with pytest.raises(FileNotFoundError): + assert pisa_cli.load_key_file_data("nonexistent_file") def test_save_signed_appointment(monkeypatch):