From 9608f0ccea8b16c66a0f6ad00b18b3cafde22af2 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 23 May 2002 04:26:05 +0000 Subject: [PATCH] 'I must run unit tests before committing\n' * 100 git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@755 57a73879-2fb5-44c3-a270-3262357dd7e2 --- doc/features.txt | 2 + test/test_init.py | 19 ++++- test/test_mailgw.py | 198 +++++++++++++++++++++++--------------------- 3 files changed, 121 insertions(+), 98 deletions(-) diff --git a/doc/features.txt b/doc/features.txt index a09b1fc..b7b688a 100644 --- a/doc/features.txt +++ b/doc/features.txt @@ -18,6 +18,8 @@ from Ka-Ping Yee in the Software Carpentry "Track" design competition. - installation takes about 10 minutes for a basic installation - two "template" schemas included in the distribution for you to base your tracker on + - doesn't need any additional support software - python (2.1+) is enough to + get you going *web interface* - fully editable interfaces for indexing and display of items diff --git a/test/test_init.py b/test/test_init.py index b21a5ff..1528023 100644 --- a/test/test_init.py +++ b/test/test_init.py @@ -15,11 +15,11 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_init.py,v 1.8 2002-05-15 03:27:16 richard Exp $ +# $Id: test_init.py,v 1.9 2002-05-23 04:26:05 richard Exp $ import unittest, os, shutil, errno, imp, sys -from roundup.init import init +from roundup import init class MyTestCase(unittest.TestCase): count = 0 @@ -43,7 +43,8 @@ class ClassicTestCase(MyTestCase): ae = self.assertEqual # create the instance - init(self.dirname, 'classic', self.backend, 'sekrit') + init.install(self.dirname, 'classic', self.backend) + init.initialise(self.dirname, 'sekrit') # check we can load the package instance = imp.load_package(self.dirname, self.dirname) @@ -73,7 +74,8 @@ class ExtendedTestCase(MyTestCase): ae = self.assertEqual # create the instance - init(self.dirname, 'extended', self.backend, 'sekrit') + init.install(self.dirname, 'extended', self.backend) + init.initialise(self.dirname, 'sekrit') # check we can load the package instance = imp.load_package(self.dirname, self.dirname) @@ -138,6 +140,15 @@ def suite(): # # $Log: not supported by cvs2svn $ +# Revision 1.8 2002/05/15 03:27:16 richard +# . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope +# (thanks dman) +# . fixed some sorting issues that were breaking some unit tests under py2.2 +# . mailgw test output dir was confusing the init test (but only on 2.2 *shrug*) +# +# fixed bug in the init unit test that meant only the bsddb test ran if it +# could (it clobbered the anydbm test) +# # Revision 1.7 2001/10/28 22:51:38 richard # Fixed ENOENT/WindowsError thing, thanks Juergen Hermann # diff --git a/test/test_mailgw.py b/test/test_mailgw.py index 956bc5f..5431488 100644 --- a/test/test_mailgw.py +++ b/test/test_mailgw.py @@ -8,7 +8,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: test_mailgw.py,v 1.18 2002-05-15 03:27:16 richard Exp $ +# $Id: test_mailgw.py,v 1.19 2002-05-23 04:26:05 richard Exp $ import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib @@ -66,7 +66,8 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance - init.init(self.dirname, self.schema, 'anydbm', 'sekrit') + init.install(self.dirname, 'classic', 'anydbm') + init.initialise(self.dirname, 'sekrit') # check we can load the package self.instance = instance.open(self.dirname) # and open the database @@ -89,7 +90,7 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: Chef Subject: [issue] Testing... @@ -110,7 +111,7 @@ This is a test submission of a new issue. message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: Chef Subject: [issue] Testing... @@ -130,7 +131,7 @@ This is a test submission of a new issue. message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: John Doe -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: Subject: [issue] Testing... @@ -149,7 +150,7 @@ This is a test submission of a new issue. message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: Chef Subject: Testing... @@ -166,7 +167,7 @@ This is a test submission of a new issue. message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: Chef Subject: [issue] Testing... [nosy=mary; assignedto=richard] @@ -178,13 +179,13 @@ This is a test submission of a new issue. handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, mary@test, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, mary@test, richard@test -From: Chef -Reply-To: Roundup issue tracker +From: Chef +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: X-Roundup-Name: Roundup issue tracker @@ -202,10 +203,10 @@ messages: 1 nosy: Chef, mary, richard status: unread title: Testing... -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') # BUG @@ -222,7 +223,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: richard -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... [assignedto=mary; nosy=john] @@ -233,13 +234,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, john@test, mary@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, john@test, mary@test -From: richard -Reply-To: Roundup issue tracker +From: richard +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -256,10 +257,10 @@ This is a followup assignedto: -> mary nosy: +mary, john status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') def testFollowup2(self): @@ -267,7 +268,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: mary -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -277,13 +278,13 @@ This is a second followup handler = self.instance.MailGW(self.instance, self.db) handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, richard@test -From: mary -Reply-To: Roundup issue tracker +From: mary +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -298,10 +299,10 @@ This is a second followup ---------- status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') def testFollowupTitleMatch(self): @@ -309,7 +310,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: richard -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: Re: Testing... [assignedto=mary; nosy=john] @@ -320,13 +321,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, john@test, mary@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, john@test, mary@test -From: richard -Reply-To: Roundup issue tracker +From: richard +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -343,10 +344,10 @@ This is a followup assignedto: -> mary nosy: +mary, john status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') def testFollowupNosyAuthor(self): @@ -355,7 +356,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: john@test -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -366,13 +367,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, richard@test -From: john -Reply-To: Roundup issue tracker +From: john +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -388,10 +389,10 @@ This is a followup ---------- nosy: +john status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -401,7 +402,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: richard@test -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Cc: john@test Message-Id: In-Reply-To: @@ -413,13 +414,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork -From: richard -Reply-To: Roundup issue tracker +From: richard +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -435,10 +436,10 @@ This is a followup ---------- nosy: +john status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -449,7 +450,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: john@test -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -460,13 +461,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, john@test, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, john@test, richard@test -From: john -Reply-To: Roundup issue tracker +From: john +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -482,10 +483,10 @@ This is a followup ---------- nosy: +john status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -495,7 +496,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: john@test -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -506,13 +507,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, richard@test -From: john -Reply-To: Roundup issue tracker +From: john +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -527,10 +528,10 @@ This is a followup ---------- status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -540,7 +541,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: richard@test -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Cc: john@test Message-Id: In-Reply-To: @@ -552,13 +553,13 @@ This is a followup handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork -From: richard -Reply-To: Roundup issue tracker +From: richard +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -573,10 +574,10 @@ This is a followup ---------- status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -585,7 +586,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: mary -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -599,13 +600,13 @@ A message with encoding (encoded oe =F6) handler = self.instance.MailGW(self.instance, self.db) handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, richard@test -From: mary -Reply-To: Roundup issue tracker +From: mary +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -619,10 +620,10 @@ A message with encoding (encoded oe =F6) ---------- status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') @@ -631,7 +632,7 @@ ___________________________________________________ message = cStringIO.StringIO('''Content-Type: text/plain; charset="iso-8859-1" From: mary -To: issue_tracker@fill.me.in. +To: issue_tracker@your.tracker.email.domain.example Message-Id: In-Reply-To: Subject: [issue1] Testing... @@ -652,13 +653,13 @@ A message with first part encoded (encoded oe =F6) handler = self.instance.MailGW(self.instance, self.db) handler.main(message) self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(), -'''FROM: roundup-admin@fill.me.in. +'''FROM: roundup-admin@your.tracker.email.domain.example TO: chef@bork.bork.bork, richard@test Content-Type: text/plain Subject: [issue1] Testing... To: chef@bork.bork.bork, richard@test -From: mary -Reply-To: Roundup issue tracker +From: mary +Reply-To: Roundup issue tracker MIME-Version: 1.0 Message-Id: In-Reply-To: @@ -672,10 +673,10 @@ A message with first part encoded (encoded oe =F6) ---------- status: unread -> chatting -___________________________________________________ -"Roundup issue tracker" -http://some.useful.url/issue1 -___________________________________________________ +_________________________________________________________________________ +"Roundup issue tracker" +http://your.tracker.url.example/issue1 +_________________________________________________________________________ ''') class ExtMailgwTestCase(MailgwTestCase): @@ -690,6 +691,15 @@ def suite(): # # $Log: not supported by cvs2svn $ +# Revision 1.18 2002/05/15 03:27:16 richard +# . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope +# (thanks dman) +# . fixed some sorting issues that were breaking some unit tests under py2.2 +# . mailgw test output dir was confusing the init test (but only on 2.2 *shrug*) +# +# fixed bug in the init unit test that meant only the bsddb test ran if it +# could (it clobbered the anydbm test) +# # Revision 1.17 2002/05/02 07:56:34 richard # . added option to automatically add the authors and recipients of messages # to the nosy lists with the options ADD_AUTHOR_TO_NOSY (default 'new') and -- 2.30.2