Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge c95badc into 8679640
Browse files Browse the repository at this point in the history
  • Loading branch information
ejdaduya committed Oct 23, 2017
2 parents 8679640 + c95badc commit 1c5ef51
Show file tree
Hide file tree
Showing 5 changed files with 1,076 additions and 40 deletions.
2 changes: 2 additions & 0 deletions contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Alessandro De Angelis

Contributors
============

Eduard Jomel Daduya
12 changes: 0 additions & 12 deletions tests/test_battlefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ def test_api_call():
assert len(response) == 4


def test_weapon_call():
bf = Battlefield('girbons', API_KEY, 'Pc')
response = bf.progression_service.get_weapon(weapon='survival knife')
assert len(response) == 4


def test_vehicle_call():
bf = Battlefield('girbons', API_KEY, 'Pc')
response = bf.progression_service.get_vehicle(vehicle='mark v landship')
assert len(response) == 4


def test_custom_api_map():
custom_api_map = {
'api': {
Expand Down
28 changes: 0 additions & 28 deletions tests/test_resolver.py

This file was deleted.

192 changes: 192 additions & 0 deletions tests/test_vehicle_resolver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
import pytest

from bf1.battlefield import Battlefield
from bf1.resolvers import resolve_vehicle

from .utils import API_KEY


def vehicle_call(vehicle):
bf = Battlefield('girbons', API_KEY, 'Pc')
response = bf.progression_service.get_vehicle(vehicle=resolve_vehicle(vehicle))
return response


def test_dr1_fighter():
response = vehicle_call("dr.1 fighter")
assert response.status_code == 200


def test_airship_l30():
response = vehicle_call("airship l30")
assert response.status_code == 200


def test_rumpler_ci_attack_plane():
response = vehicle_call("rumpler c.i attack plane")
assert response.status_code == 200


def test_mc_35hp_sidecar():
response = vehicle_call("mc 3.5hp sidecar")
assert response.status_code == 200


def test_st_chamond():
response = vehicle_call("st chamond")
assert response.status_code == 200


def test_artillery_truck():
response = vehicle_call("artillery truck")
assert response.status_code == 200


def test_horse():
response = vehicle_call("horse")
assert response.status_code == 200


def test_mc_18j_sidecar():
response = vehicle_call("mc 18j sidecar")
assert response.status_code == 200


def test_kft_scout():
response = vehicle_call("kft scout")
assert response.status_code == 200


def test_mark_v_landship():
response = vehicle_call("mark v landship")
assert response.status_code == 200


def test_fortress_gun():
response = vehicle_call("fortress gun")
assert response.status_code == 200


def test_halberstadt_cl_ii_attack_plane():
response = vehicle_call("halberstadt cl. ii attack plane")
assert response.status_code == 200


def test_char_2c():
response = vehicle_call("char 2c")
assert response.status_code == 200


def test_sopwith_camel_fighter():
response = vehicle_call("sopwith camel fighter")
assert response.status_code == 200


def test_fk_96_field_gun():
response = vehicle_call("fk 96 field gun")
assert response.status_code == 200


def test_albatros_diii__fighter():
response = vehicle_call("albatros diii fighter")
assert response.status_code == 200


def test_3795_scout():
response = vehicle_call("37/95 scout")
assert response.status_code == 200


def test_romfell_armored_car():
response = vehicle_call("romfell armored car")
assert response.status_code == 200


def test_ft_armored_car():
response = vehicle_call("f.t. armored car")
assert response.status_code == 200


def test_aef_2a2_attack_plane():
response = vehicle_call("a.e.f 2-a2 attack plane")
assert response.status_code == 200


def test_spad_s_xiii_fighter():
response = vehicle_call("spad s xiii fighter")
assert response.status_code == 200


def test_rnas_armored_car():
response = vehicle_call("rnas armored car")
assert response.status_code == 200


def test_heavy_machine_gun():
response = vehicle_call("heavy machine gun")
assert response.status_code == 200


def test_dreadnought():
response = vehicle_call("dreadnought")
assert response.status_code == 200


def test_gotha_giv_bomber():
response = vehicle_call("gotha g.iv bomber")
assert response.status_code == 200


def test_m30_scout():
response = vehicle_call("m30 scout")
assert response.status_code == 200


def test_qf_1_aa():
response = vehicle_call("qf 1 aa")
assert response.status_code == 200


def test_a7v_heavy_tank():
response = vehicle_call("a7v heavy tank")
assert response.status_code == 200


def test_ev4_armored_car():
response = vehicle_call("ev4 armored car")
assert response.status_code == 200


def test_mas_torpedo_boat():
response = vehicle_call("m.a.s. torpedo boat")
assert response.status_code == 200


def test_ft17_light_tank():
response = vehicle_call("ft-17 light tank")
assert response.status_code == 200


def test_bl_92_siege_gun():
response = vehicle_call("bl 9.2 siege gun")
assert response.status_code == 200


def test_caproni_ca5_bomber():
response = vehicle_call("caproni ca.5 bomber")
assert response.status_code == 200


def test_bristol_f2b_attack_plane():
response = vehicle_call("bristol f2.b attack plane")
assert response.status_code == 200


def test_armored_train():
response = vehicle_call("armored train")
assert response.status_code == 200


def test_he_autocannon():
response = vehicle_call("he auto-cannon")
assert response.status_code == 200
Loading

0 comments on commit 1c5ef51

Please sign in to comment.