From cf8e8e96feae8f7176bfc1bbe79a82551204dccb Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 23 Dec 2009 15:41:48 +0100 Subject: [PATCH] increase verbosity, fix testAddrPortUnique test to use the correct connstring --- pyweb/mumble/management/server_detect.py | 4 +++- pyweb/mumble/testrunner.py | 9 ++++++++- pyweb/mumble/tests.py | 9 ++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pyweb/mumble/management/server_detect.py b/pyweb/mumble/management/server_detect.py index e77a62a..f7c26c3 100644 --- a/pyweb/mumble/management/server_detect.py +++ b/pyweb/mumble/management/server_detect.py @@ -50,6 +50,8 @@ def find_existing_instances( **kwargs ): if not triedEnviron and 'MURMUR_CONNSTR' in os.environ: dbusName = os.environ['MURMUR_CONNSTR']; triedEnviron = True; + if v > 1: + print "Trying environment setting", dbusName; else: print "--- Murmur connection info ---" print " 1) DBus -- net.sourceforge.mumble.murmur" @@ -98,7 +100,7 @@ def find_existing_instances( **kwargs ): } if v > 1: - print 'Found new Murmur instance... ', + print "Found new Murmur instance %d on bus '%s'... " % ( id, dbusName ), # now create a model for the record set. instance = models.Mumble( **values ); diff --git a/pyweb/mumble/testrunner.py b/pyweb/mumble/testrunner.py index d2b6b2f..62c3161 100644 --- a/pyweb/mumble/testrunner.py +++ b/pyweb/mumble/testrunner.py @@ -71,6 +71,10 @@ def run_mumble_tests( verbosity=1, interactive=True ): settings.DEFAULT_CONN = connstrings[method]; settings.SLICE_VERSION = [ int(dgt) for dgt in version.split('.') ]; + print "MURMUR_CONNSTR:", os.environ['MURMUR_CONNSTR']; + print "DEFAULT_CONN: ", settings.DEFAULT_CONN; + print "SLICE_VERSION: ", settings.SLICE_VERSION; + if not process.capabilities.has_users: print "Waiting for user to connect (60 seconds)." wait_for_user( process, timeout=60 ); @@ -87,6 +91,9 @@ def run_mumble_tests( verbosity=1, interactive=True ): for version in get_available_versions(): MumbleCtlBase.clearCache(); - failed_tests += run_callback( version, django_run_tests_wrapper, version ); + + run = raw_input( "Run tests for %s? [Y/n] " % version ); + if run in ('Y', 'y', ''): + failed_tests += run_callback( version, django_run_tests_wrapper, version ); return failed_tests; diff --git a/pyweb/mumble/tests.py b/pyweb/mumble/tests.py index 781ed58..fc374ab 100644 --- a/pyweb/mumble/tests.py +++ b/pyweb/mumble/tests.py @@ -55,10 +55,17 @@ class InstancesHandling( TestCase ): def testAddrPortUnique( self ): try: - duplicate = Mumble( name="#another unit testing instance#", addr="0.0.0.0", port=31337 ); + duplicate = Mumble( + name="#another unit testing instance#", + addr=self.murmur.addr, port=self.murmur.port, + dbus=settings.DEFAULT_CONN + ); if duplicate.ctl.method == "ICE": import Murmur self.assertRaises( Murmur.ServerFailureException, duplicate.save ); + elif self.murmur.version[:2] == [ 1, 2 ]: + from dbus import DBusException + self.assertRaises( DBusException, duplicate.save ); else: from sqlite3 import IntegrityError self.assertRaises( IntegrityError, duplicate.save );