Browse Source

increase verbosity, fix testAddrPortUnique test to use the correct connstring

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
cf8e8e96fe
  1. 4
      pyweb/mumble/management/server_detect.py
  2. 9
      pyweb/mumble/testrunner.py
  3. 9
      pyweb/mumble/tests.py

4
pyweb/mumble/management/server_detect.py

@ -50,6 +50,8 @@ def find_existing_instances( **kwargs ):
if not triedEnviron and 'MURMUR_CONNSTR' in os.environ: if not triedEnviron and 'MURMUR_CONNSTR' in os.environ:
dbusName = os.environ['MURMUR_CONNSTR']; dbusName = os.environ['MURMUR_CONNSTR'];
triedEnviron = True; triedEnviron = True;
if v > 1:
print "Trying environment setting", dbusName;
else: else:
print "--- Murmur connection info ---" print "--- Murmur connection info ---"
print " 1) DBus -- net.sourceforge.mumble.murmur" print " 1) DBus -- net.sourceforge.mumble.murmur"
@ -98,7 +100,7 @@ def find_existing_instances( **kwargs ):
} }
if v > 1: 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. # now create a model for the record set.
instance = models.Mumble( **values ); instance = models.Mumble( **values );

9
pyweb/mumble/testrunner.py

@ -71,6 +71,10 @@ def run_mumble_tests( verbosity=1, interactive=True ):
settings.DEFAULT_CONN = connstrings[method]; settings.DEFAULT_CONN = connstrings[method];
settings.SLICE_VERSION = [ int(dgt) for dgt in version.split('.') ]; 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: if not process.capabilities.has_users:
print "Waiting for user to connect (60 seconds)." print "Waiting for user to connect (60 seconds)."
wait_for_user( process, timeout=60 ); wait_for_user( process, timeout=60 );
@ -87,6 +91,9 @@ def run_mumble_tests( verbosity=1, interactive=True ):
for version in get_available_versions(): for version in get_available_versions():
MumbleCtlBase.clearCache(); 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; return failed_tests;

9
pyweb/mumble/tests.py

@ -55,10 +55,17 @@ class InstancesHandling( TestCase ):
def testAddrPortUnique( self ): def testAddrPortUnique( self ):
try: 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": if duplicate.ctl.method == "ICE":
import Murmur import Murmur
self.assertRaises( Murmur.ServerFailureException, duplicate.save ); self.assertRaises( Murmur.ServerFailureException, duplicate.save );
elif self.murmur.version[:2] == [ 1, 2 ]:
from dbus import DBusException
self.assertRaises( DBusException, duplicate.save );
else: else:
from sqlite3 import IntegrityError from sqlite3 import IntegrityError
self.assertRaises( IntegrityError, duplicate.save ); self.assertRaises( IntegrityError, duplicate.save );

Loading…
Cancel
Save