def test_war_info(api_wrapper): """Test war info""" war = War(api_wrapper) war_page = war.page() war_id = war_page['training_war'] response = war.info(war_id) assert isinstance(response, dict), "The response should be a dict" assert isinstance(response['damage'], int), \ "Damage should be an int" assert isinstance(response['attack_hourly_available'], bool), \ "Attack hourly should be a bool" assert isinstance(response['energ_drinks'], int), \ "Energy drinks should be an int" if 'max_hero_name' in response: assert isinstance(response['max_hero_name'], str), \ "max hero name should be a str" if 'max_hero_damage' in response: assert isinstance(response['max_hero_damage'], int), \ "max hero damage should be an int" if 'time_left' in response: assert isinstance(response['time_left'], timedelta), \ "time left should be a time delta" assert isinstance(response['finish_date'], datetime), \ "Finish date should be a date" assert isinstance(response['war_units'], dict), \ "war units should be a dict"
def test_war_page(): """Test getting training war""" response = War.page() assert isinstance(response, dict), "The response should be a dict" assert isinstance(response['training_war'], int), "The training_war should be an int"