Mercurial > p > roundup > code
comparison test/test_init.py @ 332:1fe356fc3d3e
Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 28 Oct 2001 22:51:38 +0000 |
| parents | d4ef19ef17bd |
| children | e10c37f53efd |
comparison
equal
deleted
inserted
replaced
| 331:bff3a9e9548f | 332:1fe356fc3d3e |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: test_init.py,v 1.6 2001-09-29 23:48:06 richard Exp $ | 18 # $Id: test_init.py,v 1.7 2001-10-28 22:51:38 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys | 20 import unittest, os, shutil, errno, imp, sys |
| 21 | 21 |
| 22 from roundup.init import init | 22 from roundup.init import init |
| 23 | 23 |
| 27 MyTestCase.count = MyTestCase.count + 1 | 27 MyTestCase.count = MyTestCase.count + 1 |
| 28 self.dirname = '_test_%s'%self.count | 28 self.dirname = '_test_%s'%self.count |
| 29 try: | 29 try: |
| 30 shutil.rmtree(self.dirname) | 30 shutil.rmtree(self.dirname) |
| 31 except OSError, error: | 31 except OSError, error: |
| 32 if error.errno != errno.ENOENT: raise | 32 if error.errno not in (errno.ENOENT, errno.ESRCH): raise |
| 33 except WindowsError, error: | |
| 34 if error.errno != 3: raise | |
| 35 | 33 |
| 36 def tearDown(self): | 34 def tearDown(self): |
| 37 try: | 35 try: |
| 38 shutil.rmtree(self.dirname) | 36 shutil.rmtree(self.dirname) |
| 39 except OSError, error: | 37 except OSError, error: |
| 40 if error.errno != errno.ENOENT: raise | 38 if error.errno not in (errno.ENOENT, errno.ESRCH): raise |
| 41 except WindowsError, error: | |
| 42 if error.errno != 3: raise | |
| 43 | 39 |
| 44 class ClassicTestCase(MyTestCase): | 40 class ClassicTestCase(MyTestCase): |
| 45 backend = 'anydbm' | 41 backend = 'anydbm' |
| 46 def testCreation(self): | 42 def testCreation(self): |
| 47 ae = self.assertEqual | 43 ae = self.assertEqual |
| 138 | 134 |
| 139 return unittest.TestSuite(l) | 135 return unittest.TestSuite(l) |
| 140 | 136 |
| 141 # | 137 # |
| 142 # $Log: not supported by cvs2svn $ | 138 # $Log: not supported by cvs2svn $ |
| 139 # Revision 1.6 2001/09/29 23:48:06 richard | |
| 140 # Bug fix for test_init on Windows. | |
| 141 # More documenation!! | |
| 142 # | |
| 143 # Revision 1.5 2001/08/29 06:23:59 richard | 143 # Revision 1.5 2001/08/29 06:23:59 richard |
| 144 # Disabled the bsddb3 module entirely in the unit testing. See CHANGES for | 144 # Disabled the bsddb3 module entirely in the unit testing. See CHANGES for |
| 145 # details. | 145 # details. |
| 146 # | 146 # |
| 147 # Revision 1.4 2001/08/07 00:24:43 richard | 147 # Revision 1.4 2001/08/07 00:24:43 richard |
