@ -4,6 +4,7 @@ files: test_summary.py and test_summary2.py.
"""
import logging
import unittest
import actions
import summary
@ -960,49 +961,49 @@ class Address:
old = ' { " widget " : " Spinner " , " alignment " : " center " } '
self . assertTrue ( widgetOptions ( new , old ) )
# Can update but must leave other options.
new = ' { " widget " : " TextBox " , " c ant " : " center " } '
old = ' { " widget " : " Spinner " , " c ant " : " center " } '
# Can update but must leave choices options.
new = ' { " widget " : " TextBox " , " c hoices " : " center " } '
old = ' { " widget " : " Spinner " , " c hoices " : " center " } '
self . assertTrue ( widgetOptions ( new , old ) )
# Can't add protected property when old was empty.
new = ' { " widget " : " TextBox " , " c ant " : " new " } '
new = ' { " widget " : " TextBox " , " c hoices " : " new " } '
old = None
self . assertFalse ( widgetOptions ( new , old ) )
# Can't remove when there was a protected property.
new = None
old = ' { " widget " : " TextBox " , " c ant " : " old " } '
old = ' { " widget " : " TextBox " , " c hoices " : " old " } '
self . assertFalse ( widgetOptions ( new , old ) )
# Can't update by omitting.
new = ' { " widget " : " TextBox " } '
old = ' { " widget " : " TextBox " , " c ant " : " old " } '
old = ' { " widget " : " TextBox " , " c hoices " : " old " } '
self . assertFalse ( widgetOptions ( new , old ) )
# Can't update by changing.
new = ' { " widget " : " TextBox " , " c ant " : " new " } '
old = ' { " widget " : " TextBox " , " c ant " : " old " } '
new = ' { " widget " : " TextBox " , " c hoices " : " new " } '
old = ' { " widget " : " TextBox " , " c hoices " : " old " } '
self . assertFalse ( widgetOptions ( new , old ) )
# Can't update by adding.
new = ' { " widget " : " TextBox " , " c ant " : " new " } '
new = ' { " widget " : " TextBox " , " c hoices " : " new " } '
old = ' { " widget " : " TextBox " } '
self . assertFalse ( widgetOptions ( new , old ) )
# Can update objects
new = ' { " widget " : " TextBox " , " alignment " : { " prop " :1}, " c ant " : { " prop " :1}} '
old = ' { " widget " : " TextBox " , " alignment " : { " prop " :2}, " c ant " : { " prop " :1}} '
new = ' { " widget " : " TextBox " , " alignment " : { " prop " :1}, " c hoices " : { " prop " :1}} '
old = ' { " widget " : " TextBox " , " alignment " : { " prop " :2}, " c hoices " : { " prop " :1}} '
self . assertTrue ( widgetOptions ( new , old ) )
# Can't update objects
new = ' { " widget " : " TextBox " , " c ant " : { " prop " :1}} '
old = ' { " widget " : " TextBox " , " c ant " : { " prop " :2}} '
new = ' { " widget " : " TextBox " , " c hoices " : { " prop " :1}} '
old = ' { " widget " : " TextBox " , " c hoices " : { " prop " :2}} '
self . assertFalse ( widgetOptions ( new , old ) )
# Can't update lists
new = ' { " widget " : " TextBox " , " c ant " :[1, 2]} '
old = ' { " widget " : " TextBox " , " c ant " :[2, 1]} '
new = ' { " widget " : " TextBox " , " c hoices " :[1, 2]} '
old = ' { " widget " : " TextBox " , " c hoices " :[2, 1]} '
self . assertFalse ( widgetOptions ( new , old ) )
# Can update lists
@ -1011,7 +1012,10 @@ class Address:
self . assertTrue ( widgetOptions ( new , old ) )
# Can update without changing list.
new = ' { " widget " : " TextBox " , " dontChange " :[1, 2]} '
old = ' { " widget " : " Spinner " , " dontChange " :[1, 2]} '
new = ' { " widget " : " TextBox " , " choices " :[1, 2]} '
old = ' { " widget " : " Spinner " , " choices " :[1, 2]} '
self . assertTrue ( widgetOptions ( new , old ) )
# pylint: enable=R0915
if __name__ == " __main__ " :
unittest . main ( )