##// END OF EJS Templates
Fixing small bugs for the release....
Brian Granger -
Show More
@@ -18,74 +18,75 b' from IPython.kernel.core.interpreter import Interpreter'
18 18 import IPython.kernel.engineservice as es
19 19 from IPython.testing.util import DeferredTestCase
20 20 from twisted.internet.defer import succeed
21 from IPython.frontend.cocoa.cocoa_frontend import IPythonCocoaController
22
23 from Foundation import NSMakeRect
24 from AppKit import NSTextView, NSScrollView
25 21
26 class TestIPythonCocoaControler(DeferredTestCase):
27 """Tests for IPythonCocoaController"""
22 try:
23 from IPython.frontend.cocoa.cocoa_frontend import IPythonCocoaController
24 from Foundation import NSMakeRect
25 from AppKit import NSTextView, NSScrollView
26 except ImportError:
27 class TestIPythonCocoaControler(DeferredTestCase):
28 """Tests for IPythonCocoaController"""
28 29
29 def setUp(self):
30 self.controller = IPythonCocoaController.alloc().init()
31 self.engine = es.EngineService()
32 self.engine.startService()
30 def setUp(self):
31 self.controller = IPythonCocoaController.alloc().init()
32 self.engine = es.EngineService()
33 self.engine.startService()
33 34
34 35
35 def tearDown(self):
36 self.controller = None
37 self.engine.stopService()
36 def tearDown(self):
37 self.controller = None
38 self.engine.stopService()
38 39
39 def testControllerExecutesCode(self):
40 code ="""5+5"""
41 expected = Interpreter().execute(code)
42 del expected['number']
43 def removeNumberAndID(result):
44 del result['number']
45 del result['id']
46 return result
47 self.assertDeferredEquals(
48 self.controller.execute(code).addCallback(removeNumberAndID),
49 expected)
40 def testControllerExecutesCode(self):
41 code ="""5+5"""
42 expected = Interpreter().execute(code)
43 del expected['number']
44 def removeNumberAndID(result):
45 del result['number']
46 del result['id']
47 return result
48 self.assertDeferredEquals(
49 self.controller.execute(code).addCallback(removeNumberAndID),
50 expected)
50 51
51 def testControllerMirrorsUserNSWithValuesAsStrings(self):
52 code = """userns1=1;userns2=2"""
53 def testControllerUserNS(result):
54 self.assertEquals(self.controller.userNS['userns1'], 1)
55 self.assertEquals(self.controller.userNS['userns2'], 2)
52 def testControllerMirrorsUserNSWithValuesAsStrings(self):
53 code = """userns1=1;userns2=2"""
54 def testControllerUserNS(result):
55 self.assertEquals(self.controller.userNS['userns1'], 1)
56 self.assertEquals(self.controller.userNS['userns2'], 2)
56 57
57 self.controller.execute(code).addCallback(testControllerUserNS)
58 self.controller.execute(code).addCallback(testControllerUserNS)
58 59
59 60
60 def testControllerInstantiatesIEngine(self):
61 self.assert_(es.IEngineBase.providedBy(self.controller.engine))
61 def testControllerInstantiatesIEngine(self):
62 self.assert_(es.IEngineBase.providedBy(self.controller.engine))
62 63
63 def testControllerCompletesToken(self):
64 code = """longNameVariable=10"""
65 def testCompletes(result):
66 self.assert_("longNameVariable" in result)
64 def testControllerCompletesToken(self):
65 code = """longNameVariable=10"""
66 def testCompletes(result):
67 self.assert_("longNameVariable" in result)
67 68
68 def testCompleteToken(result):
69 self.controller.complete("longNa").addCallback(testCompletes)
69 def testCompleteToken(result):
70 self.controller.complete("longNa").addCallback(testCompletes)
70 71
71 self.controller.execute(code).addCallback(testCompletes)
72 self.controller.execute(code).addCallback(testCompletes)
72 73
73 74
74 def testCurrentIndent(self):
75 """test that current_indent_string returns current indent or None.
76 Uses _indent_for_block for direct unit testing.
77 """
75 def testCurrentIndent(self):
76 """test that current_indent_string returns current indent or None.
77 Uses _indent_for_block for direct unit testing.
78 """
78 79
79 self.controller.tabUsesSpaces = True
80 self.assert_(self.controller._indent_for_block("""a=3""") == None)
81 self.assert_(self.controller._indent_for_block("") == None)
82 block = """def test():\n a=3"""
83 self.assert_(self.controller._indent_for_block(block) == \
84 ' ' * self.controller.tabSpaces)
80 self.controller.tabUsesSpaces = True
81 self.assert_(self.controller._indent_for_block("""a=3""") == None)
82 self.assert_(self.controller._indent_for_block("") == None)
83 block = """def test():\n a=3"""
84 self.assert_(self.controller._indent_for_block(block) == \
85 ' ' * self.controller.tabSpaces)
85 86
86 block = """if(True):\n%sif(False):\n%spass""" % \
87 (' '*self.controller.tabSpaces,
88 2*' '*self.controller.tabSpaces)
89 self.assert_(self.controller._indent_for_block(block) == \
90 2*(' '*self.controller.tabSpaces))
87 block = """if(True):\n%sif(False):\n%spass""" % \
88 (' '*self.controller.tabSpaces,
89 2*' '*self.controller.tabSpaces)
90 self.assert_(self.controller._indent_for_block(block) == \
91 2*(' '*self.controller.tabSpaces))
91 92
@@ -20,7 +20,6 b' from twisted.internet import defer'
20 20 from IPython.kernel import engineservice as es
21 21 from IPython.kernel import multiengine as me
22 22 from IPython.kernel import newserialized
23 from IPython.kernel.error import NotDefined
24 23 from IPython.testing import util
25 24 from IPython.testing.parametric import parametric, Parametric
26 25 from IPython.kernel import newserialized
@@ -349,6 +349,39 b' IPython. The current prototype of ``tconfig`` is located in the IPython sandbox.'
349 349 .. _ConfigObj: http://www.voidspace.org.uk/python/configobj.html
350 350 .. _Traits: http://code.enthought.com/traits/
351 351
352 Installation and testing scenarios
353 ==================================
354
355 This section outlines the various scenarios that we need to test before we release an IPython version. These scenarios represent different ways of installing IPython and its dependencies.
356
357 Installation scenarios
358 ----------------------
359
360 1. Install from tarball using `python setup.py install`.
361 a. With only readline+nose dependencies installed (test1)
362 b. With all dependencies installed (readline, zope.interface,
363 Twisted, foolscap, Sphinx, nose, pyOpenSSL) (test2)
364 2. Install using easy_install.
365 a. With only readline+nose dependencies installed (test3)
366 i. Default dependencies.
367 ii. Optional dependency sets (kernel, doc, test, security)
368 easy_install -f ipython-0.9.beta3-py2.5.egg IPython[kernel,doc,test,security]
369
370 b. With all dependencies already installed (test2)
371
372
373 Tests to run for these scenarios
374 --------------------------------
375
376 1. Run the full test suite.
377 2. Start a controller and engines and try a few things by hand.
378 a. Using ipcluster.
379 b. Using ipcontroller/ipengine by hand.
380 3. Run a few of the parallel examples.
381 4. Try the kernel with and without security with and without PyOpenSSL
382 installed.
383 5. Beat on the IPython terminal a bunch.
384 6. Make sure that furl files are being put in proper locations.
352 385
353 386
354 387
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now