<s> from datetime import datetime , timedelta <EOL> from thunderdome . properties import * <EOL> from thunderdome . tests . base import BaseThunderdomeTestCase <EOL> class TestChangedProperty ( BaseThunderdomeTestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_string_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = String . value_manager ( None , None , '<STR_LIT:str>' ) <EOL> assert not vm . changed <EOL> vm . value = '<STR_LIT>' <EOL> assert vm . changed <EOL> def test_string_inplace_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = String . value_manager ( None , None , '<STR_LIT:str>' ) <EOL> assert not vm . changed <EOL> vm . value += '<STR_LIT:s>' <EOL> assert vm . changed <EOL> def test_integer_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Integer . value_manager ( None , None , <NUM_LIT:5> ) <EOL> assert not vm . changed <EOL> vm . value = <NUM_LIT:4> <EOL> assert vm . changed <EOL> def test_integer_inplace_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Integer . value_manager ( None , None , <NUM_LIT:5> ) <EOL> assert not vm . changed <EOL> vm . value += <NUM_LIT:1> <EOL> assert vm . changed <EOL> def test_datetime_update ( self ) : <EOL> """<STR_LIT>""" <EOL> now = datetime . now ( ) <EOL> vm = DateTime . value_manager ( None , None , now ) <EOL> assert not vm . changed <EOL> vm . value = now + timedelta ( days = <NUM_LIT:1> ) <EOL> assert vm . changed <EOL> def test_decimal_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Decimal . value_manager ( None , None , D ( '<STR_LIT>' ) ) <EOL> assert not vm . changed <EOL> vm . value = D ( '<STR_LIT>' ) <EOL> assert vm . changed <EOL> def test_decimal_inplace_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Decimal . value_manager ( None , None , D ( '<STR_LIT>' ) ) <EOL> assert not vm . changed <EOL> vm . value += D ( '<STR_LIT>' ) <EOL> assert vm . changed <EOL> def test_dictionary_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Dictionary . value_manager ( None , None , { <NUM_LIT:1> : <NUM_LIT:2> , <NUM_LIT:3> : <NUM_LIT:4> } ) <EOL> assert not vm . changed <EOL> vm . value = { <NUM_LIT:4> : <NUM_LIT:5> } <EOL> assert vm . changed <EOL> def test_dictionary_inplace_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = Dictionary . value_manager ( None , None , { <NUM_LIT:1> : <NUM_LIT:2> , <NUM_LIT:3> : <NUM_LIT:4> } ) <EOL> assert not vm . changed <EOL> vm . value [ <NUM_LIT:4> ] = <NUM_LIT:5> <EOL> assert vm . changed <EOL> def test_list_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = List . value_manager ( None , None , [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> assert not vm . changed <EOL> vm . value = [ <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ] <EOL> assert vm . changed <EOL> def test_list_inplace_update ( self ) : <EOL> """<STR_LIT>""" <EOL> vm = List . value_manager ( None , None , [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> assert not vm . changed <EOL> vm . value . append ( <NUM_LIT:4> ) <EOL> assert vm . changed </s>
