From c5443cf9138b059070d5237d0bda2857b0c3c856 Mon Sep 17 00:00:00 2001 From: Ondrej Mikle Date: Sat, 19 Jul 2014 23:08:37 +0200 Subject: [PATCH] Tests show repr() of database objects. --- brmdoor_authenticator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/brmdoor_authenticator.py b/brmdoor_authenticator.py index ed76ea3..4d0eea3 100644 --- a/brmdoor_authenticator.py +++ b/brmdoor_authenticator.py @@ -21,7 +21,8 @@ class UidRecord(object): return "(uid: %s, nick: %s)" % (self.uid_hex, self.nick) def __repr__(self): - return "" % (self.uid_hex, self.nick) + return "" % \ + (repr(self.uid_hex), repr(self.nick)) class UidAuthenticator(object): """Checks UIDs of ISO14443 RFID cards against database.""" @@ -65,12 +66,12 @@ if __name__ == "__main__": authenticator = UidAuthenticator("test_uids_db.sqlite") record = authenticator.fetchUidRecord("043a1482cc2280") - print "For UID 043a1482cc2280 we found:", str(record) + print "For UID 043a1482cc2280 we found:", repr(record) record = authenticator.fetchUidRecord("34795fad") - print "For UID 34795fad we found:", str(record) + print "For UID 34795fad we found:", repr(record) record = authenticator.fetchUidRecord("01020304") - print "For UID 01020304 we found:", str(record) + print "For UID 01020304 we found:", repr(record) authenticator.shutdown()