1010from python_toolbox import import_tools
1111from python_toolbox .temp_value_setters import TempValueSetter
1212
13- import garlicsim
13+ import python_toolbox
1414from python_toolbox .address_tools import (describe ,
1515 resolve )
1616
@@ -25,8 +25,8 @@ def test_locally_defined_class():
2525 # Testing for locally defined class:
2626
2727
28- if garlicsim .__version_info__ <= (0 , 6 , 3 ):
29- raise nose .SkipTest ("This test doesn't pass in `garlicsim ` version "
28+ if python_toolbox .__version_info__ <= (0 , 6 , 3 ):
29+ raise nose .SkipTest ("This test doesn't pass in `python_toolbox ` version "
3030 "0.6.3 and below, because `describe` doesn't "
3131 "support nested classes yet." )
3232
@@ -69,78 +69,79 @@ def test_stdlib():
6969 email .encoders
7070
7171
72- def test_garlicsim ():
73- '''Test `describe` for various `garlicsim` modules.'''
72+ # blocktodo: convert to python_toolbox
73+ #def test_garlicsim():
74+ #'''Test `describe` for various `garlicsim` modules.'''
7475
75- import garlicsim
76- result = describe (garlicsim .data_structures .state .State )
77- assert result == 'garlicsim.data_structures.state.State'
78- assert resolve (result ) is garlicsim .data_structures .state .State
79-
80- result = describe (garlicsim .data_structures .state .State , shorten = True )
81- assert result == 'garlicsim.data_structures.State'
82- assert resolve (result ) is garlicsim .data_structures .state .State
83-
84- result = describe (garlicsim .Project , shorten = True )
85- assert result == 'garlicsim.Project'
86- assert resolve (result ) is garlicsim .Project
87-
88- # When a root or namespace is given, it's top priority to use it, even if
89- # it prevents shorterning and results in an overall longer address:
90- result = describe (garlicsim .Project , shorten = True ,
91- root = garlicsim .asynchronous_crunching )
92- assert result == 'asynchronous_crunching.Project'
93- assert resolve (result , root = garlicsim .asynchronous_crunching ) is \
94- garlicsim .Project
95-
96- result = describe (garlicsim .Project , shorten = True ,
97- namespace = garlicsim )
98- assert result == 'Project'
99- assert resolve (result , namespace = garlicsim ) is garlicsim .Project
100-
101- result = describe (garlicsim .Project , shorten = True ,
102- namespace = garlicsim .__dict__ )
103- assert result == 'Project'
104- assert resolve (result , namespace = garlicsim .__dict__ ) is \
105- garlicsim .Project
106-
107- result = describe (garlicsim .Project , shorten = True ,
108- namespace = 'garlicsim' )
109- assert result == 'Project'
110- assert resolve (result , namespace = 'garlicsim' ) is garlicsim .Project
111-
112- result = describe (garlicsim .Project , shorten = True ,
113- namespace = 'garlicsim.__dict__' )
114- assert result == 'Project'
115- assert resolve (result , namespace = 'garlicsim.__dict__' ) is \
116- garlicsim .Project
117-
118- result = describe (garlicsim .data_structures .state .State , root = garlicsim )
119- assert result == 'garlicsim.data_structures.state.State'
120- assert resolve (result , root = garlicsim ) is \
121- garlicsim .data_structures .state .State
122-
123-
124- import garlicsim_lib .simpacks .life
125-
126- result = describe (garlicsim_lib .simpacks .life .state .State .step )
127- assert result == 'garlicsim_lib.simpacks.life.state.State.step'
128-
129- result = describe (garlicsim_lib .simpacks .life .state .State .step ,
130- shorten = True )
131- assert result == 'garlicsim_lib.simpacks.life.State.step'
132-
133- result = describe (garlicsim_lib .simpacks .life .state .State .step ,
134- root = garlicsim_lib .simpacks .life )
135- assert result == 'life.state.State.step'
136-
137- result = describe (garlicsim_lib .simpacks .life .state .State .step ,
138- namespace = garlicsim_lib .simpacks )
139- assert result == 'life.state.State.step'
140-
141- result = describe (garlicsim_lib .simpacks .life .state .State .step ,
142- root = garlicsim_lib .simpacks .life , shorten = True )
143- assert result == 'life.State.step'
76+ # import garlicsim
77+ # result = describe(garlicsim.data_structures.state.State)
78+ # assert result == 'garlicsim.data_structures.state.State'
79+ # assert resolve(result) is garlicsim.data_structures.state.State
80+
81+ # result = describe(garlicsim.data_structures.state.State, shorten=True)
82+ # assert result == 'garlicsim.data_structures.State'
83+ # assert resolve(result) is garlicsim.data_structures.state.State
84+
85+ # result = describe(garlicsim.Project, shorten=True)
86+ # assert result == 'garlicsim.Project'
87+ # assert resolve(result) is garlicsim.Project
88+
89+ ## When a root or namespace is given, it's top priority to use it, even if
90+ ## it prevents shorterning and results in an overall longer address:
91+ # result = describe(garlicsim.Project, shorten=True,
92+ # root=garlicsim.asynchronous_crunching)
93+ # assert result == 'asynchronous_crunching.Project'
94+ # assert resolve(result, root=garlicsim.asynchronous_crunching) is \
95+ # garlicsim.Project
96+
97+ # result = describe(garlicsim.Project, shorten=True,
98+ # namespace=garlicsim)
99+ # assert result == 'Project'
100+ # assert resolve(result, namespace=garlicsim) is garlicsim.Project
101+
102+ # result = describe(garlicsim.Project, shorten=True,
103+ # namespace=garlicsim.__dict__)
104+ # assert result == 'Project'
105+ # assert resolve(result, namespace=garlicsim.__dict__) is \
106+ # garlicsim.Project
107+
108+ # result = describe(garlicsim.Project, shorten=True,
109+ # namespace='garlicsim')
110+ # assert result == 'Project'
111+ # assert resolve(result, namespace='garlicsim') is garlicsim.Project
112+
113+ # result = describe(garlicsim.Project, shorten=True,
114+ # namespace='garlicsim.__dict__')
115+ # assert result == 'Project'
116+ # assert resolve(result, namespace='garlicsim.__dict__') is \
117+ # garlicsim.Project
118+
119+ # result = describe(garlicsim.data_structures.state.State, root=garlicsim)
120+ # assert result == 'garlicsim.data_structures.state.State'
121+ # assert resolve(result, root=garlicsim) is \
122+ # garlicsim.data_structures.state.State
123+
124+
125+ # import garlicsim_lib.simpacks.life
126+
127+ # result = describe(garlicsim_lib.simpacks.life.state.State.step)
128+ # assert result == 'garlicsim_lib.simpacks.life.state.State.step'
129+
130+ # result = describe(garlicsim_lib.simpacks.life.state.State.step,
131+ # shorten=True)
132+ # assert result == 'garlicsim_lib.simpacks.life.State.step'
133+
134+ # result = describe(garlicsim_lib.simpacks.life.state.State.step,
135+ # root=garlicsim_lib.simpacks.life)
136+ # assert result == 'life.state.State.step'
137+
138+ # result = describe(garlicsim_lib.simpacks.life.state.State.step,
139+ # namespace=garlicsim_lib.simpacks)
140+ # assert result == 'life.state.State.step'
141+
142+ # result = describe(garlicsim_lib.simpacks.life.state.State.step,
143+ # root=garlicsim_lib.simpacks.life, shorten=True)
144+ # assert result == 'life.State.step'
144145
145146
146147def test_local_modules ():
0 commit comments