##// END OF EJS Templates
Fake _winreg in tests for non windows platforms
Jorgen Stenarson -
Show More
@@ -28,7 +28,12 b' from os.path import join, abspath'
28 28 try:
29 29 import _winreg as wreg
30 30 except ImportError:
31 pass
31 #Fake _winreg module on none windows platforms
32 import new
33 sys.modules["_winreg"]=new.module("_winreg")
34 import _winreg as wreg
35 #Add entries that needs to be stubbed by the testing code
36 (wreg.OpenKey, wreg.QueryValueEx,) = (None, None)
32 37
33 38 skip_if_not_win32 = skipif(sys.platform!='win32',"This test only runs under Windows")
34 39
@@ -55,6 +60,9 b' def teardown_environment():'
55 60
56 61 with_enivronment=with_setup(setup_environment, teardown_environment)
57 62
63
64
65
58 66 @with_enivronment
59 67 def test_get_home_dir_1():
60 68 """Testcase to see if we can call get_home_dir without Exceptions."""
@@ -130,8 +138,6 b' def test_get_home_dir_8():'
130 138 home_dir = genutils.get_home_dir()
131 139 assert home_dir==abspath(join(".", "home_test_dir"))
132 140
133
134
135 141 # Should we stub wreg fully so we can run the test on all platforms?
136 142 @skip_if_not_win32
137 143 @with_enivronment
@@ -193,7 +199,6 b' def test_get_ipython_dir_4():'
193 199 assert ipdir == os.path.abspath(os.path.join("someplace", "_ipython"))
194 200
195 201
196
197 202 #
198 203 # Tests for get_security_dir
199 204 #
@@ -204,8 +209,9 b' def test_get_security_dir():'
204 209 sdir = genutils.get_security_dir()
205 210
206 211
207
208
212 #
213 # Tests for popkey
214 #
209 215
210 216 def test_popkey_1():
211 217 dct=dict(a=1, b=2, c=3)
General Comments 0
You need to be logged in to leave comments. Login now