diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1940.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1940.txt new file mode 100644 index 0000000..e28b1cf --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1940.txt @@ -0,0 +1,12 @@ +=== vehicles/landing-craft/1940 === + +Name Capabilities (effective) # Notes Comments +-------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] +LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Unarmored & unarmed | Normal Range = 8 +LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 +LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +Daihatsu DP 3 CS 4 DP 3 CS 4 7† A†1 AAMG: Rear/port-side only | Front as Open-Topped AFV +Shohatsu DP 2 CS 3 DP 2 CS 3 8† A† D Passengers: BU NA | Front as Open-Topped AFV | No ramp, (un)load ×2 [EXC: Pier] diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1941.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1941.txt new file mode 100644 index 0000000..a94b48e --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1941.txt @@ -0,0 +1,12 @@ +=== vehicles/landing-craft/1941 === + +Name Capabilities (effective) # Notes Comments +-------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] +LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Unarmored & unarmed | Normal Range = 8 +LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 +LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +Daihatsu DP 3 CS 4 DP 3 CS 4 7† A†1 AAMG: Rear/port-side only | Front as Open-Topped AFV +Shohatsu DP 2 CS 3 DP 2 CS 3 8† A† D Passengers: BU NA | Front as Open-Topped AFV | No ramp, (un)load ×2 [EXC: Pier] diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1942.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1942.txt new file mode 100644 index 0000000..d8331f8 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1942.txt @@ -0,0 +1,12 @@ +=== vehicles/landing-craft/1942 === + +Name Capabilities (effective) # Notes Comments +-------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] +LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Unarmored & unarmed | Normal Range = 8 +LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 +LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +Daihatsu DP 3 CS 4 DP 3 CS 4 7† A†1 AAMG: Rear/port-side only | Front as Open-Topped AFV +Shohatsu DP 2 CS 3 DP 2 CS 3 8† A† D Passengers: BU NA | Front as Open-Topped AFV | No ramp, (un)load ×2 [EXC: Pier] diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1943.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1943.txt new file mode 100644 index 0000000..611a46b --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1943.txt @@ -0,0 +1,12 @@ +=== vehicles/landing-craft/1943 === + +Name Capabilities (effective) # Notes Comments +-------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] +LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Unarmored & unarmed | Normal Range = 8 +LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 +LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +Daihatsu DP 3 CS 4 DP 3 CS 4 7† A†1 AAMG: Rear/port-side only | Front as Open-Topped AFV +Shohatsu DP 2 CS 3 DP 2 CS 3 8† A† D Passengers: BU NA | Front as Open-Topped AFV | No ramp, (un)load ×2 [EXC: Pier] diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/landing-craft.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1944.txt similarity index 96% rename from vasl_templates/webapp/tests/fixtures/vo-reports/landing-craft.txt rename to vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1944.txt index 9695d6e..fd41713 100644 --- a/vasl_templates/webapp/tests/fixtures/vo-reports/landing-craft.txt +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1944.txt @@ -1,10 +1,10 @@ -=== landing craft === +=== vehicles/landing-craft/1944 === Name Capabilities (effective) # Notes Comments -------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP -LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Unarmored & unarmed (pre-6/43) | Normal Range = 8 +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Normal Range = 8 LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1945.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1945.txt new file mode 100644 index 0000000..f96ec9c --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/vehicles/landing-craft/1945.txt @@ -0,0 +1,12 @@ +=== vehicles/landing-craft/1945 === + +Name Capabilities (effective) # Notes Comments +-------- -------------- ------------- --- ------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +LCP(L) DP 2 CS 4 DP 2 CS 4 1† A†1 B†3 C†2 D British: Unarmored & unarmed; Inherent Crew | MA: 4&4 | Front as Open-Topped AFV | Normal Range = 8 | No ramp, (un)load ×2 [EXC: Pier] +LCA DP 3 CS 6 DP 3 CS 6 2† n/a Personnel/SW only | Collateral Attacks: ½ FP +LCVP DP 3 CS 5 DP 3 CS 5 3† B†2 C†1 Inherent Crew | MA: 4&4 | Normal Range = 8 +LCM(3) DP 5 CS 6 DP 5 CS 6 4† B†2 C†1 MA: 2&2 or 6&6 | Normal Range = 8 +LCI(S) DP 14 CS 10 DP 14 CS 10 5† C†3 D E†2 F†1 G AAMG: 2&2 | -3 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Cloaked Passengers | No ramp, (un)load ×2 [EXC: Pier] | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +LCT(4) DP 10 CS 9 DP 10 CS 9 6† C†3 E†2 F†1 G -4 Target Size [{ *:One-level LOS obstacle across Side *:Units may not move through Location }] | Infantry Stack unload | MA: 2× AA [{ *:IFE Normal Range = 16 *:VCA and/or adjacent/same-hex ≤ level NA }] | Stun: dr ≥ 5 | Unbeaching: -1 DRM +Daihatsu DP 3 CS 4 DP 3 CS 4 7† A†1 AAMG: Rear/port-side only | Front as Open-Topped AFV +Shohatsu DP 2 CS 3 DP 2 CS 3 8† A† D Passengers: BU NA | Front as Open-Topped AFV | No ramp, (un)load ×2 [EXC: Pier] diff --git a/vasl_templates/webapp/tests/test_vo_reports.py b/vasl_templates/webapp/tests/test_vo_reports.py index 93ad3d9..85c53a3 100644 --- a/vasl_templates/webapp/tests/test_vo_reports.py +++ b/vasl_templates/webapp/tests/test_vo_reports.py @@ -58,7 +58,7 @@ def test_vo_reports( webapp, webdriver ): #pylint: disable=too-many-locals # check each vehicle/ordnance report nationalities = list( get_nationalities( webapp ).keys() ) - nationalities.extend( [ "allied-minor-common", "axis-minor-common" ] ) + nationalities.extend( [ "allied-minor-common", "axis-minor-common", "landing-craft" ] ) failed = False for nat in nationalities: @@ -73,6 +73,8 @@ def test_vo_reports( webapp, webdriver ): #pylint: disable=too-many-locals for year in range(years[0],years[1]+1): # get the next report + if nat == "landing-craft" and vo_type == "ordnance": + continue results = get_vo_report( webapp, webdriver, vo_type, nat, "ETO", year, 1 ) if nat in ("burmese","filipino") or (nat,vo_type) in [("anzac","ordnance"),("kfw-cpva","vehicles")]: assert not results @@ -119,35 +121,6 @@ def test_vo_reports( webapp, webdriver ): #pylint: disable=too-many-locals assert not failed - # get the landing craft report - url = webapp.url_for( "get_lc_report" ) - webdriver.get( url ) - wait_for( 2, lambda: find_child("#results").is_displayed() ) - results = _parse_report( webdriver.page_source ) - - # convert the report to plain-text - assert results[0][-2] == "Notes" - results[0].insert( len(results[0])-2, "#" ) - assert results[0][-4] == "Capabilities" - results[0].insert( len(results[0])-3, "(effective)" ) - buf = io.StringIO() - print( "=== landing craft ===", file=buf ) - print( "", file=buf ) - print( - tabulate.tabulate( results, headers="firstrow" ), - file = buf - ) - report = buf.getvalue() - - # check if we should save the report - if save_dir: - with open( os.path.join(save_dir,"landing-craft.txt"), "w" ) as fp: - fp.write( report ) - - # check the report - fname = os.path.join( check_dir, "landing-craft.txt" ) - assert open(fname,"r",encoding="utf-8").read() == report - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def get_vo_report( webapp, webdriver, diff --git a/vasl_templates/webapp/vo.py b/vasl_templates/webapp/vo.py index e3af197..4e372d9 100644 --- a/vasl_templates/webapp/vo.py +++ b/vasl_templates/webapp/vo.py @@ -174,7 +174,7 @@ def _do_load_vo_listings( vasl_mod, vo_type, merge_common, real_data_dir, msg_st # --------------------------------------------------------------------- -@app.route( "////", defaults={"month":1} ) +@app.route( "////", defaults={"month":1} ) @app.route( "/////" ) def get_vo_report( vo_type, nat, theater, year, month ): """Get a vehicle/ordnance report.""" @@ -190,12 +190,3 @@ def get_vo_report( vo_type, nat, theater, year, month ): YEAR = year, MONTH = month, ) - -@app.route( "/landing_craft" ) -def get_lc_report(): - """Get a landing craft ordnance report.""" - return render_template( "vo-report.html", - VO_TYPE = "landing-craft", - YEAR = "null", - MONTH = "null", - )