Skip to content

Commit 91a44ca

Browse files
committed
Added joker_info test
1 parent b1d5357 commit 91a44ca

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test_bat_functions.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
2-
from bat_functions import calculate_bat_power, signal_strength, get_bat_vehicle
2+
from bat_functions import *
3+
from unittest.mock import patch
34

45
@pytest.mark.bat_power
56
def test_calculate_bat_power():
@@ -38,4 +39,11 @@ def test_known_or_unknown_vehicle(bat_vehicles_dict):
3839
get_bat_vehicle(keys[2])
3940
with pytest.raises(ValueError, match="Unknown vehicle: Batboat"):
4041
get_bat_vehicle(keys[3])
41-
assert get_bat_vehicle(keys[4]) == bat_vehicles_dict['Batwing']
42+
assert get_bat_vehicle(keys[4]) == bat_vehicles_dict['Batwing']
43+
44+
@pytest.mark.joker_info
45+
def test_fetch_joker_info():
46+
with patch("bat_functions.fetch_joker_info", return_value={'mischief_level': 50, 'location': 'Gotham City Hall'}):
47+
info = fetch_joker_info()
48+
assert info['mischief_level'] == 50
49+
assert info['location'] == 'Gotham City Hall'

0 commit comments

Comments
 (0)