Roundup Tracker - Issues

Message4580

Author wking
Recipients wking
Date 2012-06-28.16:06:23
Message-id <20120628160559.GC31654@odin.tremily.us>
In-reply-to <patchbomb.1340390571@mjolnir>
# HG changeset patch
# User W. Trevor King <wking@tremily.us>
# Date 1340390137 14400
# Node ID c43a1c8c5a403fbab2f03182e02d2f13c95a56f7
# Parent  139a50e588d0052ee04cc75dcb78e05e8c16dedc
Add testAdminDuplicateInitialisation to db_test_base.py

This shows how issue2550757 is currently failing.

diff -r 139a50e588d0 -r c43a1c8c5a40 test/db_test_base.py
--- a/test/db_test_base.py	Fri Jun 22 14:30:36 2012 -0400
+++ b/test/db_test_base.py	Fri Jun 22 14:35:37 2012 -0400
@@ -1854,6 +1854,33 @@
             roundup.admin.sys = sys
             shutil.rmtree('_test_export')

+    # test duplicate relative tracker home initialisation (issue2550757)
+    def testAdminDuplicateInitialisation(self):
+        import roundup.admin
+        output = []
+        def stderrwrite(s):
+            output.append(s)
+        roundup.admin.sys = MockNull ()
+        t = '_test_initialise'
+        try:
+            roundup.admin.sys.stderr.write = stderrwrite
+            tool = roundup.admin.AdminTool()
+            tool.force = True
+            args = (None, 'classic', 'anydbm',
+                    'MAIL_DOMAIN=%s' % config.MAIL_DOMAIN)
+            tool.do_install(t, args=args)
+            args = (None, 'mypasswd')
+            tool.do_initialise(t, args=args)
+            tool.do_initialise(t, args=args)
+            try:  # python >=2.7
+                self.assertNotIn(t, os.listdir(t))
+            except AttributeError:
+                self.assertFalse('db' in os.listdir(t))
+        finally:
+            roundup.admin.sys = sys
+            if os.path.exists(t):
+                shutil.rmtree(t)
+
     def testAddProperty(self):
         self.db.issue.create(title="spam", status='1')
         self.db.commit()
History
Date User Action Args
2012-06-28 16:06:23wkingsetrecipients: + wking
2012-06-28 16:06:23wkinglinkissue2550757 messages
2012-06-28 16:06:23wkingcreate