<s> """<STR_LIT>""" <EOL> import unittest <EOL> import param <EOL> class TestObjectSelectorParameters ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> class P ( param . Parameterized ) : <EOL> e = param . ObjectSelector ( default = <NUM_LIT:5> , objects = [ <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> ] ) <EOL> f = param . ObjectSelector ( default = <NUM_LIT:10> ) <EOL> h = param . ObjectSelector ( default = None ) <EOL> g = param . ObjectSelector ( default = None , objects = [ <NUM_LIT:7> , <NUM_LIT:8> ] ) <EOL> i = param . ObjectSelector ( default = <NUM_LIT:7> , objects = [ <NUM_LIT:9> ] , check_on_set = False ) <EOL> self . P = P <EOL> def test_set_object_constructor ( self ) : <EOL> p = self . P ( e = <NUM_LIT:6> ) <EOL> self . assertEqual ( p . e , <NUM_LIT:6> ) <EOL> def test_set_object_outside_bounds ( self ) : <EOL> p = self . P ( e = <NUM_LIT:6> ) <EOL> try : <EOL> p . e = <NUM_LIT:9> <EOL> except ValueError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> def test_set_object_setattr ( self ) : <EOL> p = self . P ( e = <NUM_LIT:6> ) <EOL> p . f = <NUM_LIT:9> <EOL> self . assertEqual ( p . f , <NUM_LIT:9> ) <EOL> p . g = <NUM_LIT:7> <EOL> self . assertEqual ( p . g , <NUM_LIT:7> ) <EOL> p . i = <NUM_LIT:12> <EOL> self . assertEqual ( p . i , <NUM_LIT:12> ) <EOL> def test_set_object_not_None ( self ) : <EOL> p = self . P ( e = <NUM_LIT:6> ) <EOL> p . g = <NUM_LIT:7> <EOL> try : <EOL> p . g = None <EOL> except ValueError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> def test_set_object_setattr_post_error ( self ) : <EOL> p = self . P ( e = <NUM_LIT:6> ) <EOL> p . f = <NUM_LIT:9> <EOL> self . assertEqual ( p . f , <NUM_LIT:9> ) <EOL> p . g = <NUM_LIT:7> <EOL> try : <EOL> p . g = None <EOL> except ValueError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> self . assertEqual ( p . g , <NUM_LIT:7> ) <EOL> p . i = <NUM_LIT:12> <EOL> self . assertEqual ( p . i , <NUM_LIT:12> ) <EOL> def test_initialization_out_of_bounds ( self ) : <EOL> try : <EOL> class Q ( param . Parameterized ) : <EOL> q = param . ObjectSelector ( <NUM_LIT:5> , objects = [ <NUM_LIT:4> ] ) <EOL> except ValueError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> def test_initialization_no_bounds ( self ) : <EOL> try : <EOL> class Q ( param . Parameterized ) : <EOL> q = param . ObjectSelector ( <NUM_LIT:5> , objects = <NUM_LIT:10> ) <EOL> except TypeError : <EOL> pass <EOL> else : <EOL> raise AssertionError ( "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import nose <EOL> nose . runmodule ( ) </s>
