File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
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
3
4
4
5
@pytest .mark .bat_power
5
6
def test_calculate_bat_power ():
@@ -38,4 +39,11 @@ def test_known_or_unknown_vehicle(bat_vehicles_dict):
38
39
get_bat_vehicle (keys [2 ])
39
40
with pytest .raises (ValueError , match = "Unknown vehicle: Batboat" ):
40
41
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'
You can’t perform that action at this time.
0 commit comments