Skip to content

Commit

Permalink
fix unit tests (mostly py3k string nonsense)
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@14869 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 28, 2017
1 parent cd4a437 commit ed32795
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/unittests/unit/server/proxy_server_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class ProxyServerTest(ServerTestUtil):
def test_proxy_start_stop(self):
display = self.find_free_display()
log("using free display=%s" % display)
proxy = self.run_xpra(["proxy", display, "--no-daemon"])
assert pollwait(proxy, 5) is None, "proxy failed to start"
cmd = ["proxy", display, "--no-daemon"]
cmdstr = " ".join("'%s'" % c for c in cmd)
proxy = self.run_xpra(cmd)
assert pollwait(proxy, 5) is None, "proxy failed to start with cmd=%s" % cmdstr
assert display in self.dotxpra.displays(), "proxy display not found"
self.check_stop_server(proxy, "stop", display)

Expand Down
5 changes: 3 additions & 2 deletions src/xpra/codecs/jpeg/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,11 @@ def selftest(full=False):
log("decompress(%i bytes)=%s", len(data), img)
if full:
try:
assert decompress(data[:len(data)//2], 16, 16) is not None
v = decompress(data[:len(data)//2], 16, 16)
assert v is not None
except:
pass
else:
raise Exception("should not be able to decompress incomplete data")
raise Exception("should not be able to decompress incomplete data, but got %s" % v)
finally:
pass
7 changes: 4 additions & 3 deletions src/xpra/server/auth/pam_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import sys
from xpra.server.auth.sys_auth_base import SysAuthenticator, init, log
from xpra.util import csv
assert init and log #tests will disable logging from here


Expand Down Expand Up @@ -93,9 +94,9 @@ def check(self, password):
return check(self.username, password)

def get_challenge(self, digests):
if b"xor" not in digests:
raise Exception("pam authenticator requires the 'xor' digest")
return SysAuthenticator.get_challenge(self, [b"xor"])
if "xor" not in digests:
raise Exception("pam authenticator requires the 'xor' digest, not %s" % csv(digests))
return SysAuthenticator.get_challenge(self, ["xor"])

def __repr__(self):
return "PAM"
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/server/auth/sys_auth_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def authenticate_hmac(self, challenge_response, client_salt):
salt = self.salt
else:
salt = xor(self.salt, client_salt)
log("xoring salt: xor(%s, %s)=%s", self.salt, client_salt, binascii.hexlify(salt))
log("xoring salt: xor(%s, %s)=%s", self.salt, client_salt, binascii.hexlify(strtobytes(salt)))
self.salt = None
password = self.get_password()
if not password:
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def init_uuid(self):
# Define a server UUID if needed:
self.uuid = self.get_uuid()
if not self.uuid:
self.uuid = unicode(get_hex_uuid())
self.uuid = bytestostr(get_hex_uuid())
self.save_uuid()
log("server uuid is %s", self.uuid)

Expand Down

0 comments on commit ed32795

Please sign in to comment.