parent
4443a662c5
commit
42a1b16709
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 9.0 KiB |
@ -0,0 +1,16 @@ |
||||
[ |
||||
|
||||
{ "title": "Kampfgrupper Scherer", |
||||
"chapter_id": "KGS", |
||||
"page_no": 1, |
||||
"sections": [ |
||||
{ "caption": ".1 - .9 Miscellaneous", "page_no": 5 }, |
||||
{ "caption": "KGS1: Snow-Sangar", "ruleid": "KGS1" }, |
||||
{ "caption": "KGS2: Terrain", "ruleid": "KGS2" }, |
||||
{ "caption": "KGS3: German Army Characteristics", "ruleid": "KGS3" }, |
||||
{ "caption": "KGS4: Russian Army Characteristics", "ruleid": "KGS4" }, |
||||
{ "caption": "KGS5: Glossary Of Terms", "ruleid": "KGS5" } |
||||
] |
||||
} |
||||
|
||||
] |
@ -0,0 +1,12 @@ |
||||
{ |
||||
|
||||
"KGS": { |
||||
|
||||
"39": { |
||||
"captions": [ { "ruleid": "KGS_CG1" } ], |
||||
"content": "These areas were vital to maintaining either the supply depot or the aerial bridgehead for Cholm. The loss of even one of these areas could well have spelled doom to the besieged garrison." |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@ |
||||
[ |
||||
|
||||
{ "title": "Flugfeld Security Blocks, Sector G or Haarnadelkurve Block Bonus", |
||||
"content": "Flugfeld Security Blocks: Blocks 4, 9, 14 and 17. See KGS CG1.", |
||||
"ruleids": [ "KGS_CG1" ] |
||||
} |
||||
|
||||
] |
@ -0,0 +1,11 @@ |
||||
{ |
||||
|
||||
"KGS1": { "caption": "SNOW-SANGAR", "page_no": 7 }, |
||||
"KGS2": { "caption": "TERRAIN", "page_no": 7 }, |
||||
"KGS3": { "caption": "GERMAN ARMY CHARACTERISTICS", "page_no": 10 }, |
||||
"KGS4": { "caption": "Russian Army Characteristics", "page_no": 11 }, |
||||
"KGS5": { "caption": "Glossary Of Terms", "page_no": 13 }, |
||||
|
||||
"KGS_CG1": { "caption": "Flugfeld Security Blocks, Sector G or Haarnadelkurve Block Bonus", "page_no": 15 } |
||||
|
||||
} |
@ -0,0 +1,42 @@ |
||||
""" Test underscores in ruleid's. """ |
||||
|
||||
from asl_rulebook2.webapp.tests.test_search import do_search |
||||
from asl_rulebook2.webapp.tests.utils import init_webapp, refresh_webapp, \ |
||||
wait_for, get_curr_target, get_last_footnote_msg |
||||
|
||||
# --------------------------------------------------------------------- |
||||
|
||||
def test_search_results( webdriver, webapp ): |
||||
"""Test presentation of ruleid's in search results.""" |
||||
|
||||
# initialize |
||||
webapp.control_tests.set_data_dir( "full" ) |
||||
init_webapp( webapp, webdriver ) |
||||
|
||||
# check the presentation of ruleid's in search results |
||||
results = do_search( "flugfeld" ) |
||||
assert len(results) == 1 |
||||
assert results[0]["ruleids"] == [ "KGS CG1" ] # nb: no underscore |
||||
|
||||
# test searching for a ruleid that has an underscore |
||||
for ruleid in ( "kgs cg1", "kgs_cg1" ): |
||||
refresh_webapp( webdriver ) |
||||
results = do_search( ruleid ) |
||||
assert results == [] |
||||
assert get_curr_target() == ( 'kampfgruppe-scherer!', 'KGS_CG1' ) |
||||
|
||||
# --------------------------------------------------------------------- |
||||
|
||||
def test_footnotes( webdriver, webapp ): |
||||
"""Test presentation of ruleid's in footnotes.""" |
||||
|
||||
# initialize |
||||
webapp.control_tests.set_data_dir( "full" ) |
||||
init_webapp( webapp, webdriver ) |
||||
|
||||
# search for a rule that has an underscore in its ruleid, and has a footnote |
||||
do_search( "flugfeld" ) |
||||
assert get_curr_target() == ( 'kampfgruppe-scherer!', 'KGS_CG1' ) |
||||
wait_for( 2, |
||||
lambda: "<span class='caption'>KGS CG1</span>" in get_last_footnote_msg() |
||||
) |
Loading…
Reference in new issue