Added the Italian ordnance.

master
Pacman Ghost 6 years ago
parent 13ba18936f
commit 899d3f93d7
  1. 114
      vasl_templates/webapp/data/ordnance/italian.json
  2. 2
      vasl_templates/webapp/static/snippets.js
  3. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1940.txt
  4. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1941.txt
  5. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1942.txt
  6. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1943.txt
  7. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1944.txt
  8. 24
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/italian/1945.txt
  9. 32
      vasl_templates/webapp/tests/test_capabilities.py

@ -0,0 +1,114 @@
[
{ "name": "Mortaio da 45 \"Brixia\"",
"capabilities_other": [ "4PP" ],
"note_number": "1",
"notes": [ "N" ]
},
{ "name": "Mortaio da 81/14",
"capabilities": [ "NT", "QSU", "IR" ],
"capabilities2": { "s": 8 },
"note_number": "2\u2020",
"notes": [ "N" ]
},
{ "name": "Fucile-cc S",
"capabilities_other": [ "5PP" ],
"note_number": "3",
"notes": [ "N" ]
},
{ "name": "Cannone-cc da 37/45",
"capabilities": [ "NT", "QSU" ],
"note_number": "4\u2020",
"notes": [ "C", "N", "<s>R</s>" ]
},
{ "name": "Cannone da 47/32",
"capabilities": [ "NT", "QSU", "no Gunshield" ],
"capabilities2": { "Towed": [ [null,"A1+"], "\u2020" ] },
"note_number": "5\u2020",
"notes": [ "A", "C", "N" ]
},
{ "name": "Cannone da 65/17",
"capabilities": [ "NT", "no Gunshield" ],
"capabilities2": { "H": [ [6,"S2+"], "\u2020<sup>1</sup>" ] },
"note_number": "6\u2020",
"notes": [ "A", "C", "H\u2020<sup>1</sup>", "N" ]
},
{ "name": "Cannone da 70/15",
"capabilities": [ "NT", "QSU", "Acq. NA\u2020<sup>1</sup>", "no Gunshield", "h-d" ],
"note_number": "7\u2020",
"notes": [ "A", "B\u2020<sup>1</sup>", "<s>R</s>" ]
},
{ "name": "Obice da 75/13",
"capabilities": [ "NT", "QSU" ],
"note_number": "8\u2020",
"notes": [ "A" ]
},
{ "name": "Cannone da 75/27",
"capabilities": [ "NT", "QSU" ],
"capabilities2": { "H": [ [6,"S2+"], "\u2020<sup>1</sup>" ] },
"note_number": "9\u2020",
"notes": [ "A", "C", "H\u2020<sup>1</sup>", "N" ]
},
{ "name": "Obice da 75/18",
"capabilities": [ "NT", "QSU" ],
"capabilities2": { "H": [ [6,"S2+"], "\u2020<sup>1</sup>" ], "s": 8 },
"note_number": "10\u2020",
"notes": [ "A", "H\u2020<sup>1</sup>", "N" ]
},
{ "name": "Cannone da 75/32",
"capabilities": [ "NT", "QSU" ],
"capabilities2": { "H": [ [6,"S2+"], "\u2020<sup>1</sup>" ], "s": 8 },
"note_number": "11\u2020",
"notes": [ "H\u2020<sup>1</sup>" ]
},
{ "name": "Obice da 100/17",
"capabilities": [ "NT" ],
"capabilities2": { "H": [ [6,"S2+"], "\u2020<sup>1</sup>" ] },
"note_number": "12\u2020",
"notes": [ "A", "H\u2020<sup>1</sup>", "N" ]
},
{ "name": "Cannone da 105/28",
"capabilities": [ "NT" ],
"capabilities2": { "s": 8 },
"note_number": "13\u2020",
"notes": [ "N" ]
},
{ "name": "Obice 149/13",
"capabilities": [ "NT" ],
"note_number": "14\u2020",
"notes": [ "N" ]
},
{ "name": "Cannone da 149/35",
"capabilities": [ "NT", "RFNM", "no IF", "Acq. NA\u2020<sup>1</sup>" ],
"capabilities2": { "s": 8 },
"note_number": "15\u2020",
"notes": [ "B\u2020<sup>1</sup>", "N", "<s>R</s>" ]
},
{ "name": "Cannone da 149/40",
"capabilities": [ "NT", "RFNM" ],
"note_number": "16\u2020",
"notes": [ "N" ]
},
{ "name": "Cannone-mitr. da 20/65",
"capabilities": [ "T" ],
"capabilities2": { "LF": [ "NT", "20\u2020", "2 ROF" ] },
"note_number": "17\u2020",
"notes": [ "A", "C", "N" ]
},
{ "name": "Cannone-aa da 75/39",
"capabilities": [ "T" ],
"capabilities_other": [ "\"16\" AP TK#\u2020" ],
"note_number": "18\u2020"
},
{ "name": "Cannone-aa da 75/46",
"capabilities": [ "T" ],
"note_number": "19\u2020",
"notes": [ "N" ]
},
{ "name": "Cannone-aa da 90/53",
"capabilities": [ "T" ],
"note_number": "20\u2020",
"notes": [ "N", "<s>R</s>" ]
}
]

@ -287,7 +287,7 @@ function make_capabilities( entry, scenario_theater, scenario_year, scenario_mon
capabilities.push( "LF [" + entry.capabilities2[key].join(", ") + "]" ) ;
continue ;
}
if ( $.inArray( key, ["HE","AP","A","D","C","H","s","sM","sD","sN","WP","IR"] ) === -1 ) {
if ( $.inArray( key, ["HE","AP","A","D","C","H","s","sM","sD","sN","WP","IR","Towed"] ) === -1 ) {
unexpected_caps.push( key ) ;
continue ;
}

@ -0,0 +1,24 @@
=== ordnance/italian/1940 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -0,0 +1,24 @@
=== ordnance/italian/1941 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -0,0 +1,24 @@
=== ordnance/italian/1942 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield Towed† 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -0,0 +1,24 @@
=== ordnance/italian/1943 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield Towed† 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield H6†[1] 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU H6†[1] 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT H6†[1] 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -0,0 +1,24 @@
=== ordnance/italian/1944 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield Towed† 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield H6†[1] 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU H6†[1] 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT H6†[1] 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -0,0 +1,24 @@
=== ordnance/italian/1945 ===
Name Capabilities (effective) # Notes
---------------------- ----------------------------------- ----------------------------------- --- -------------------------
Mortaio da 45 "Brixia" 4PP 4PP 1 N
Mortaio da 81/14 NT QSU IR s8 NT QSU IR s8 2† N
Fucile-cc S 5PP 5PP 3 N
Cannone-cc da 37/45 NT QSU NT QSU 4† C N <s>R</s>
Cannone da 47/32 NT QSU no Gunshield Towed[A1+]† NT QSU no Gunshield Towed† 5† A C N
Cannone da 65/17 NT no Gunshield H6[S2+]†[1] NT no Gunshield H6†[1] 6† A C H†<sup>1</sup> N
Cannone da 70/15 NT QSU Acq. NA†[1] no Gunshield h-d NT QSU Acq. NA†[1] no Gunshield h-d 7† A B†<sup>1</sup> <s>R</s>
Obice da 75/13 NT QSU NT QSU 8† A
Cannone da 75/27 NT QSU H6[S2+]†[1] NT QSU H6†[1] 9† A C H†<sup>1</sup> N
Obice da 75/18 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 10† A H†<sup>1</sup> N
Cannone da 75/32 NT QSU H6[S2+]†[1] s8 NT QSU H6†[1] s8 11† H†<sup>1</sup>
Obice da 100/17 NT H6[S2+]†[1] NT H6†[1] 12† A H†<sup>1</sup> N
Cannone da 105/28 NT s8 NT s8 13† N
Obice 149/13 NT NT 14† N
Cannone da 149/35 NT RFNM no IF Acq. NA†[1] s8 NT RFNM no IF Acq. NA†[1] s8 15† B†<sup>1</sup> N <s>R</s>
Cannone da 149/40 NT RFNM NT RFNM 16† N
Cannone-mitr. da 20/65 T LF [NT, 20†, 2 ROF] T LF [NT, 20†, 2 ROF] 17† A C N
Cannone-aa da 75/39 T "16" AP TK#† T "16" AP TK#† 18† n/a
Cannone-aa da 75/46 T T 19† N
Cannone-aa da 90/53 T T 20† N <s>R</s>

@ -228,6 +228,23 @@ def test_month_capabilities( webapp, webdriver ):
_check_capabilities( webdriver, webapp, *vehicle, "ETO", "06/1944", "WP7\u2020<sup>1</sup> s8" )
_check_capabilities( webdriver, webapp, *vehicle, "ETO", "01/1945", "WP7\u2020<sup>1</sup> s8" )
# Cannone da 47/32: Towed(A1+)†
ordnance = [ "italian", "ordnance", "Cannone da 47/32" ]
_check_capabilities( webdriver, webapp, *ordnance, "ETO", "12/1940", "NT QSU no Gunshield" )
_check_capabilities( webdriver, webapp, *ordnance, "ETO", "07/1941", "NT QSU no Gunshield" )
_check_capabilities( webdriver, webapp, *ordnance, "ETO", "08/1941", "NT QSU no Gunshield Towed\u2020" )
_check_capabilities( webdriver, webapp, *ordnance, "ETO", "01/1942", "NT QSU no Gunshield Towed\u2020" )
# Cannone da 65/17, 75/27, 75/32 + Obice da 75/18: H6(S2+)†1
for vo_name in ("Cannone da 65/17", "Cannone da 75/27","Cannone da 75/32","Obice da 75/18"):
ordnance = [ "italian", "ordnance", vo_name ]
val = _get_capabilities( webdriver, webapp, *ordnance, "ETO", "12/1941" )
assert "H6" not in val
assert _get_capabilities( webdriver, webapp, *ordnance, "ETO", "08/1942" ) == val
val2 = _get_capabilities( webdriver, webapp, *ordnance, "ETO", "09/1942" )
assert "H6\u2020<sup>1</sup>" in val2
assert _get_capabilities( webdriver, webapp, *ordnance, "ETO", "01/1943" ) == val2
# ---------------------------------------------------------------------
@pytest.mark.skipif(
@ -308,7 +325,15 @@ def _check_capabilities( webdriver, webapp,
nat, vo_type, vo_name, scenario_theater, scenario_date,
expected, row=None
): #pylint: disable=too-many-arguments
"""Check the vehicle/ordnance capabilities for the specified parameters.
"""Check the vehicle/ordnance capabilities for the specified parameters."""
capabilities = _get_capabilities( webdriver, webapp, nat, vo_type, vo_name, scenario_theater, scenario_date, row )
assert capabilities == expected
def _get_capabilities( webdriver, webapp,
nat, vo_type, vo_name, scenario_theater, scenario_date,
row=None
): #pylint: disable=too-many-arguments
"""Get the vehicle/ordnance capabilities for the specified parameters.
NOTE: We're only interested in checking the generated capabilities, not testing the UI,
so we use a V/O report to get the information out of the webapp, which is significantly faster.
@ -328,10 +353,9 @@ def _check_capabilities( webdriver, webapp,
# check the capabilities
if vo_type == "vehicles":
assert "Capabilities" in results[0][4]
capabilities = results[row_no][5]
return results[row_no][5]
elif vo_type == "ordnance":
assert "Capabilities" in results[0][1]
capabilities = results[row_no][2]
return results[row_no][2]
else:
assert False
assert capabilities == expected

Loading…
Cancel
Save