<s> import random <EOL> import string <EOL> from htmlPy import settings <EOL> from . utilities import html_with_string <EOL> class BaseGUIJavascript ( object ) : <EOL> """<STR_LIT>""" <EOL> right_click_simulator = """<STR_LIT>""" <EOL> def test_javascript_execution ( self ) : <EOL> random_string = "<STR_LIT>" . join ( random . sample ( string . ascii_letters , <NUM_LIT:32> ) ) <EOL> javascript = "<STR_LIT>" . format ( random_string ) <EOL> self . app . evaluate_javascript ( javascript ) <EOL> assert random_string in self . app . html <EOL> def test_right_click_default ( self ) : <EOL> self . app . evaluate_javascript ( self . right_click_simulator ) <EOL> assert self . app . html == html_with_string ( "<STR_LIT:true>" ) <EOL> def test_right_click_enabled ( self ) : <EOL> self . app . right_click_setting ( settings . DISABLE ) <EOL> self . app . right_click_setting ( settings . ENABLE ) <EOL> self . test_right_click_default ( ) <EOL> def test_right_click_disabled ( self ) : <EOL> self . app . right_click_setting ( settings . DISABLE ) <EOL> self . app . evaluate_javascript ( self . right_click_simulator ) <EOL> assert self . app . html == html_with_string ( "<STR_LIT:false>" ) <EOL> def test_right_click_input_only_non_input ( self ) : <EOL> self . app . right_click_setting ( settings . INPUTS_ONLY ) <EOL> self . app . evaluate_javascript ( self . right_click_simulator ) <EOL> assert self . app . html == html_with_string ( "<STR_LIT:false>" ) <EOL> def test_right_click_input_only_input ( self ) : <EOL> self . app . right_click_setting ( settings . INPUTS_ONLY ) <EOL> self . app . evaluate_javascript ( "<STR_LIT>" + <EOL> "<STR_LIT>" ) <EOL> self . app . evaluate_javascript ( self . right_click_simulator . replace ( <EOL> "<STR_LIT>" , "<STR_LIT:input>" ) ) <EOL> assert self . app . html == html_with_string ( "<STR_LIT:true>" ) <EOL> def test_right_click_enabled_persistent ( self ) : <EOL> self . test_right_click_enabled ( ) <EOL> self . reloader ( ) <EOL> self . test_right_click_default ( ) <EOL> def test_right_click_disabled_persistent ( self ) : <EOL> self . test_right_click_disabled ( ) <EOL> self . reloader ( ) <EOL> try : <EOL> self . test_right_click_default ( ) <EOL> except AssertionError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> def test_right_click_input_only_non_input_persistent ( self ) : <EOL> self . test_right_click_input_only_non_input ( ) <EOL> self . reloader ( ) <EOL> try : <EOL> self . test_right_click_default ( ) <EOL> except AssertionError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> def test_right_click_input_only_input_persistent ( self ) : <EOL> self . test_right_click_input_only_input ( ) <EOL> self . reloader ( ) <EOL> self . app . evaluate_javascript ( "<STR_LIT>" + <EOL> "<STR_LIT>" ) <EOL> self . app . evaluate_javascript ( self . right_click_simulator . replace ( <EOL> "<STR_LIT>" , "<STR_LIT:input>" ) ) <EOL> assert self . app . html == html_with_string ( "<STR_LIT:true>" ) </s>
