Renamed a test support function.

master
Pacman Ghost 4 years ago
parent 605c56c302
commit 4e3ee7d08c
  1. 2
      vasl_templates/webapp/tests/test_counters.py
  2. 16
      vasl_templates/webapp/tests/test_lfa.py
  3. 4
      vasl_templates/webapp/tests/test_scenario_search.py
  4. 28
      vasl_templates/webapp/tests/test_vassal.py

@ -258,7 +258,7 @@ def test_gpid_remapping( webapp, webdriver ):
# run the tests using VASL 6.4.4 and 6.5.0
# NOTE: Versions of VASL prior to 6.6.0 are no longer officially supported (since they use Java 8),
# but we would still like to run these tests. See VassalShim._run_vassal_shim(), where we figure out
# which version of Java to use, and _run_tests() in test_vassal.py, where we check for invalid
# which version of Java to use, and run_vassal_tests() in test_vassal.py, where we check for invalid
# combinations of VASSAL and VASL. Sigh...
do_test( find_vasl_mod("6.4.4"), True )
do_test( find_vasl_mod("6.5.0"), True )

@ -10,7 +10,7 @@ from selenium.webdriver.support.ui import Select
from vasl_templates.webapp.tests.utils import init_webapp, select_menu_option, \
wait_for, wait_for_elem, find_child, find_children, set_stored_msg, set_stored_msg_marker, get_stored_msg, \
get_droplist_vals, select_droplist_val, unload_table
from vasl_templates.webapp.tests.test_vassal import _run_tests
from vasl_templates.webapp.tests.test_vassal import run_vassal_tests
# ---------------------------------------------------------------------
@ -127,7 +127,7 @@ def test_full( webapp, webdriver ):
find_child( "#lfa button.ui-dialog-titlebar-close" ).click()
# run the tests
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# ---------------------------------------------------------------------
@ -212,7 +212,7 @@ def test_4players( webapp, webdriver ):
find_child( "#lfa button.ui-dialog-titlebar-close" ).click()
# run the tests
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# ---------------------------------------------------------------------
@ -385,7 +385,7 @@ def test_multiple_files( webapp, webdriver ):
find_child( "#lfa button.ui-dialog-titlebar-close" ).click()
# run the tests
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# ---------------------------------------------------------------------
@ -431,7 +431,7 @@ def test_3d6( webapp, webdriver ):
find_child( "#lfa button.ui-dialog-titlebar-close" ).click()
# run the tests
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# ---------------------------------------------------------------------
@ -465,7 +465,7 @@ def test_banner_updates( webapp, webdriver ):
find_child( "#lfa button.ui-dialog-titlebar-close" ).click()
# run the tests
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# ---------------------------------------------------------------------
@ -505,7 +505,7 @@ def test_download_data( webapp, webdriver ):
]
# run the test
_run_tests( control_tests, do_test, False )
run_vassal_tests( control_tests, do_test, False )
# ---------------------------------------------------------------------
@ -544,7 +544,7 @@ def test_custom_labels( webapp, webdriver ):
]
# run the test
_run_tests( control_tests, do_test, False )
run_vassal_tests( control_tests, do_test, False )
# ---------------------------------------------------------------------

@ -11,6 +11,7 @@ from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import StaleElementReferenceException
from vasl_templates.webapp.tests.test_scenario_persistence import save_scenario, load_scenario
from vasl_templates.webapp.tests.test_vassal import run_vassal_tests
from vasl_templates.webapp.tests.utils import init_webapp, select_tab, new_scenario, \
set_player, set_template_params, set_scenario_date, get_player_nat, get_theater, set_theater, \
wait_for, wait_for_elem, find_child, find_children, get_css_classes, set_stored_msg, click_dialog_button
@ -626,8 +627,7 @@ def test_scenario_upload( webapp, webdriver ):
assert isinstance( asa_upload["vt_setup"], dict )
assert asa_upload["vasl_setup"][:3] == "PK:"
assert asa_upload["screenshot"][:5] == "JPEG:"
from vasl_templates.webapp.tests.test_vassal import _run_tests
_run_tests( control_tests, do_test, True )
run_vassal_tests( control_tests, do_test, True )
# ---------------------------------------------------------------------

@ -209,10 +209,10 @@ def test_full_update( webapp, webdriver ):
assert updated_vsav_data == b"No changes."
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, lambda: do_test(True), True )
run_vassal_tests( control_tests, lambda: do_test(True), True )
# run the test again (once) with no Chapter H vehicle/ordnance notes
_run_tests( control_tests, lambda: do_test(False), False )
run_vassal_tests( control_tests, lambda: do_test(False), False )
# ---------------------------------------------------------------------
@ -282,7 +282,7 @@ def test_latw_autocreate( webapp, webdriver ):
# NOTE: We're testing the logic in the front/back-ends that determine whether LATW labels
# get created/updated/deleted, not the interaction with VASSAL, so we don't need to test
# against every VASSAL+VASL combination (although we can, if we want, but it'll be slow!)
_run_tests( control_tests, do_test, False )
run_vassal_tests( control_tests, do_test, False )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -343,7 +343,7 @@ def test_latw_update( webapp, webdriver ):
# NOTE: We're testing the logic in the front/back-ends that determine whether LATW labels
# get created/updated/deleted, not the interaction with VASSAL, so we don't need to test
# against every VASSAL+VASL combination (although we can, if we want, but it'll be slow!)
_run_tests( control_tests, do_test, False )
run_vassal_tests( control_tests, do_test, False )
# ---------------------------------------------------------------------
@ -368,7 +368,7 @@ def test_dump_vsav( webapp, webdriver ):
assert vsav_dump == expected
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, do_test, True )
run_vassal_tests( control_tests, do_test, True )
# ---------------------------------------------------------------------
@ -451,10 +451,10 @@ def test_update_legacy_labels( webapp, webdriver ):
_check_vsav_dump( updated_vsav_dump, expected )
# run the test
_run_tests( control_tests, lambda: do_test(True), False )
run_vassal_tests( control_tests, lambda: do_test(True), False )
# run the test again (once) with no Chapter H vehicle/ordnance notes
_run_tests( control_tests, lambda: do_test(False), False )
run_vassal_tests( control_tests, lambda: do_test(False), False )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -531,7 +531,7 @@ def test_update_legacy_latw_labels( webapp, webdriver ):
assert len( [ lbl for lbl in labels if "vasl-templates:id" not in lbl ] ) == 6
# run the test
_run_tests( control_tests, do_test, False )
run_vassal_tests( control_tests, do_test, False )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -588,7 +588,7 @@ def test_player_owned_labels( webapp, webdriver ):
}, ignore=["scenario","players","victory_conditions"] )
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, do_test, True )
run_vassal_tests( control_tests, do_test, True )
# ---------------------------------------------------------------------
@ -674,7 +674,7 @@ def test_analyze_vsav( webapp, webdriver ):
)
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -699,7 +699,7 @@ def test_analyze_vsav_hip_concealed( webapp, webdriver ):
)
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
run_vassal_tests( control_tests, do_test, not pytest.config.option.short_tests ) #pylint: disable=no-member
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -725,7 +725,7 @@ def test_reverse_remapped_gpids( webapp, webdriver ):
)
# run the test against all versions of VASSAL+VASL
_run_tests( control_tests, do_test,
run_vassal_tests( control_tests, do_test,
not pytest.config.option.short_tests, #pylint: disable=no-member
min_vasl_version="6.5.0"
)
@ -774,11 +774,11 @@ def test_vo_entry_selection_for_theater( webapp, webdriver ):
# NOTE The other variants always get imported as K:FW counters.
("kfw-un-common/o:002","12689/0"), ("kfw-un-common/o:002","11391/0"), ("kfw-un-common/o:002","11440/0")
] )
_run_tests( control_tests, do_tests, True, min_vasl_version="6.5.0" )
run_vassal_tests( control_tests, do_tests, True, min_vasl_version="6.5.0" )
# ---------------------------------------------------------------------
def _run_tests( control_tests, func, test_all, min_vasl_version=None ):
def run_vassal_tests( control_tests, func, test_all, min_vasl_version=None ):
"""Run the test function for each combination of VASSAL + VASL.
This is, of course, going to be insanely slow, since we need to spin up a JVM

Loading…
Cancel
Save