##// END OF EJS Templates
Removing simple test cases for get_home_dir and get_ipython_dir
Jorgen Stenarson -
Show More
@@ -62,16 +62,8 b' def teardown_environment():'
62
62
63 with_enivronment = with_setup(setup_environment, teardown_environment)
63 with_enivronment = with_setup(setup_environment, teardown_environment)
64
64
65
66
67
68 @with_enivronment
65 @with_enivronment
69 def test_get_home_dir_1():
66 def test_get_home_dir_1():
70 """Testcase to see if we can call get_home_dir without Exceptions."""
71 home_dir = genutils.get_home_dir()
72
73 @with_enivronment
74 def test_get_home_dir_2():
75 """Testcase for py2exe logic, un-compressed lib
67 """Testcase for py2exe logic, un-compressed lib
76 """
68 """
77 sys.frozen = True
69 sys.frozen = True
@@ -83,7 +75,7 b' def test_get_home_dir_2():'
83 assert home_dir == abspath(join(test_file_path, "home_test_dir"))
75 assert home_dir == abspath(join(test_file_path, "home_test_dir"))
84
76
85 @with_enivronment
77 @with_enivronment
86 def test_get_home_dir_3():
78 def test_get_home_dir_2():
87 """Testcase for py2exe logic, compressed lib
79 """Testcase for py2exe logic, compressed lib
88 """
80 """
89 sys.frozen=True
81 sys.frozen=True
@@ -94,14 +86,14 b' def test_get_home_dir_3():'
94 assert home_dir == abspath(join(test_file_path, "home_test_dir")).lower()
86 assert home_dir == abspath(join(test_file_path, "home_test_dir")).lower()
95
87
96 @with_enivronment
88 @with_enivronment
97 def test_get_home_dir_4():
89 def test_get_home_dir_3():
98 """Testcase $HOME is set, then use its value as home directory."""
90 """Testcase $HOME is set, then use its value as home directory."""
99 env["HOME"] = join(test_file_path,"home_test_dir")
91 env["HOME"] = join(test_file_path,"home_test_dir")
100 home_dir = genutils.get_home_dir()
92 home_dir = genutils.get_home_dir()
101 assert home_dir == env["HOME"]
93 assert home_dir == env["HOME"]
102
94
103 @with_enivronment
95 @with_enivronment
104 def test_get_home_dir_5():
96 def test_get_home_dir_4():
105 """Testcase $HOME is not set, os=='posix'.
97 """Testcase $HOME is not set, os=='posix'.
106 This should fail with HomeDirError"""
98 This should fail with HomeDirError"""
107
99
@@ -114,7 +106,7 b' def test_get_home_dir_5():'
114 pass
106 pass
115
107
116 @with_enivronment
108 @with_enivronment
117 def test_get_home_dir_6():
109 def test_get_home_dir_5():
118 """Testcase $HOME is not set, os=='nt'
110 """Testcase $HOME is not set, os=='nt'
119 env['HOMEDRIVE'],env['HOMEPATH'] points to path."""
111 env['HOMEDRIVE'],env['HOMEPATH'] points to path."""
120
112
@@ -126,7 +118,7 b' def test_get_home_dir_6():'
126 assert home_dir == abspath(join(test_file_path, "home_test_dir"))
118 assert home_dir == abspath(join(test_file_path, "home_test_dir"))
127
119
128 @with_enivronment
120 @with_enivronment
129 def test_get_home_dir_8():
121 def test_get_home_dir_6():
130 """Testcase $HOME is not set, os=='nt'
122 """Testcase $HOME is not set, os=='nt'
131 env['HOMEDRIVE'],env['HOMEPATH'] do not point to path.
123 env['HOMEDRIVE'],env['HOMEPATH'] do not point to path.
132 env['USERPROFILE'] points to path
124 env['USERPROFILE'] points to path
@@ -143,7 +135,7 b' def test_get_home_dir_8():'
143 # Should we stub wreg fully so we can run the test on all platforms?
135 # Should we stub wreg fully so we can run the test on all platforms?
144 #@skip_if_not_win32
136 #@skip_if_not_win32
145 @with_enivronment
137 @with_enivronment
146 def test_get_home_dir_9():
138 def test_get_home_dir_7():
147 """Testcase $HOME is not set, os=='nt'
139 """Testcase $HOME is not set, os=='nt'
148 env['HOMEDRIVE'],env['HOMEPATH'], env['USERPROFILE'] missing
140 env['HOMEDRIVE'],env['HOMEPATH'], env['USERPROFILE'] missing
149 """
141 """
@@ -172,12 +164,6 b' def test_get_home_dir_9():'
172
164
173 @with_enivronment
165 @with_enivronment
174 def test_get_ipython_dir_1():
166 def test_get_ipython_dir_1():
175 """1 Testcase to see if we can call get_ipython_dir without Exceptions."""
176 ipdir = genutils.get_ipython_dir()
177
178
179 @with_enivronment
180 def test_get_ipython_dir_2():
181 """2 Testcase to see if we can call get_ipython_dir without Exceptions."""
167 """2 Testcase to see if we can call get_ipython_dir without Exceptions."""
182 env['IPYTHONDIR'] = "someplace/.ipython"
168 env['IPYTHONDIR'] = "someplace/.ipython"
183 ipdir = genutils.get_ipython_dir()
169 ipdir = genutils.get_ipython_dir()
@@ -185,7 +171,7 b' def test_get_ipython_dir_2():'
185
171
186
172
187 @with_enivronment
173 @with_enivronment
188 def test_get_ipython_dir_3():
174 def test_get_ipython_dir_2():
189 """3 Testcase to see if we can call get_ipython_dir without Exceptions."""
175 """3 Testcase to see if we can call get_ipython_dir without Exceptions."""
190 genutils.get_home_dir=lambda : "someplace"
176 genutils.get_home_dir=lambda : "someplace"
191 os.name = "posix"
177 os.name = "posix"
@@ -193,7 +179,7 b' def test_get_ipython_dir_3():'
193 assert ipdir == os.path.abspath(os.path.join("someplace", ".ipython"))
179 assert ipdir == os.path.abspath(os.path.join("someplace", ".ipython"))
194
180
195 @with_enivronment
181 @with_enivronment
196 def test_get_ipython_dir_4():
182 def test_get_ipython_dir_3():
197 """4 Testcase to see if we can call get_ipython_dir without Exceptions."""
183 """4 Testcase to see if we can call get_ipython_dir without Exceptions."""
198 genutils.get_home_dir = lambda : "someplace"
184 genutils.get_home_dir = lambda : "someplace"
199 os.name = "nt"
185 os.name = "nt"
General Comments 0
You need to be logged in to leave comments. Login now