From 7af8bb922a38d2f19d773faf58d1397dff260f62 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 4 Aug 2008 21:51:32 +0100 Subject: [PATCH] git8 - updated the 3 ps testdatas and regression test --- pyfpdb/fpdb.py | 1 + pyfpdb/fpdb_db.py | 3 +-- testdata/ps.14519394979.expected.txt | 8 +++++++- testdata/ps.14519420999.expected.txt | 8 +++++++- testdata/ps.14519433154.expected.txt | 8 +++++++- utils/regression-test.sh | 19 +++++++++---------- 6 files changed, 32 insertions(+), 15 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index b0bc8f58..b13166ab 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -111,6 +111,7 @@ class fpdb: def dia_database_stats(self, widget, data): print "todo: implement dia_database_stats" + #string=fpdb_db.getDbStats(db, cursor) #end def dia_database_stats def dia_delete_db_parts(self, widget, data): diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index dcc4a8fa..62506f0d 100755 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -23,7 +23,6 @@ class fpdb_db: """Simple constructor, doesnt really do anything""" self.db=None self.cursor=None - self.MYSQL=1 self.MYSQL_INNODB=2 self.PGSQL=3 #end def __init__ @@ -36,7 +35,7 @@ class fpdb_db: self.user=user self.password=password #print "fpdb_db.connect, password:",password,"/end" - if backend==self.MYSQL or backend==self.MYSQL_INNODB: + if backend==self.MYSQL_INNODB: import MySQLdb print "fpdb_db.connect, host:", host, " user:", user, " passwd:", password, " db:", database self.db=MySQLdb.connect(host = host, user = user, passwd = password, db = database) diff --git a/testdata/ps.14519394979.expected.txt b/testdata/ps.14519394979.expected.txt index 6bcaa016..3c5f86d8 100644 --- a/testdata/ps.14519394979.expected.txt +++ b/testdata/ps.14519394979.expected.txt @@ -1,8 +1,14 @@ Connected to MySQL on localhost. Print Hand Utility options.site: PokerStars site_id: 2 + +From Table gametypes +==================== +type: ring category: holdem limit_type: fl +sb: 1 bb: 2 sbet: 2 bbet: 4 + From Table hands ================ -site_hand_no: 14519394979 hand_start: 2008-01-13 05:22:15 seat_count: 7 category: holdem +site_hand_no: 14519394979 hand_start: 2008-01-13 05:22:15 seat_count: 7 Board cards: Qd Th Js 2s 7s From Table hands_players diff --git a/testdata/ps.14519420999.expected.txt b/testdata/ps.14519420999.expected.txt index 3be7f2b8..5c1de6de 100644 --- a/testdata/ps.14519420999.expected.txt +++ b/testdata/ps.14519420999.expected.txt @@ -1,8 +1,14 @@ Connected to MySQL on localhost. Print Hand Utility options.site: PokerStars site_id: 2 + +From Table gametypes +==================== +type: ring category: holdem limit_type: fl +sb: 1 bb: 2 sbet: 2 bbet: 4 + From Table hands ================ -site_hand_no: 14519420999 hand_start: 2008-01-13 05:23:43 seat_count: 7 category: holdem +site_hand_no: 14519420999 hand_start: 2008-01-13 05:23:43 seat_count: 7 Board cards: Th Jd 3c 7c 4s From Table hands_players diff --git a/testdata/ps.14519433154.expected.txt b/testdata/ps.14519433154.expected.txt index 764d3d8e..81000579 100644 --- a/testdata/ps.14519433154.expected.txt +++ b/testdata/ps.14519433154.expected.txt @@ -1,8 +1,14 @@ Connected to MySQL on localhost. Print Hand Utility options.site: PokerStars site_id: 2 + +From Table gametypes +==================== +type: ring category: holdem limit_type: fl +sb: 1 bb: 2 sbet: 2 bbet: 4 + From Table hands ================ -site_hand_no: 14519433154 hand_start: 2008-01-13 05:24:25 seat_count: 7 category: holdem +site_hand_no: 14519433154 hand_start: 2008-01-13 05:24:25 seat_count: 7 Board cards: 4h 9s Ad Qc Ks From Table hands_players diff --git a/utils/regression-test.sh b/utils/regression-test.sh index 96c86a3c..252db6ce 100755 --- a/utils/regression-test.sh +++ b/utils/regression-test.sh @@ -16,25 +16,24 @@ #agpl-3.0.txt in the docs folder of the package. rm ../testdata/*.found.txt -../fpdb-python/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x -../fpdb-python/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x -../fpdb-python/fpdb_import.py -p$1 --file=../testdata/ftp-stud-hilo-ring-001.txt -x -../fpdb-python/fpdb_import.py -p$1 --file=../testdata/ftp-omaha-hi-pl-ring-001-005.txt -x +../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x +../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ps-holdem-ring-001to003.txt -x +#../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ftp-stud-hilo-ring-001.txt -x +#../pyfpdb/fpdb_import.py -p$1 --file=../testdata/ftp-omaha-hi-pl-ring-001-005.txt -x -echo "it should've reported first that it stored 3, then that it had 3 duplicates," -echo " then 1 stored, then 5 stored" +echo "it should've reported first that it stored 3, then that it had 3 duplicates" +#echo " then 1 stored, then 5 stored" ./print_hand.py -p$1 --hand=14519394979 > ../testdata/ps.14519394979.found.txt && colordiff ../testdata/ps.14519394979.found.txt ../testdata/ps.14519394979.expected.txt ./print_hand.py -p$1 --hand=14519420999 > ../testdata/ps.14519420999.found.txt && colordiff ../testdata/ps.14519420999.found.txt ../testdata/ps.14519420999.expected.txt ./print_hand.py -p$1 --hand=14519433154 > ../testdata/ps.14519433154.found.txt && colordiff ../testdata/ps.14519433154.found.txt ../testdata/ps.14519433154.expected.txt -./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6367428246 > ../testdata/ftp.6367428246.found.txt && colordiff ../testdata/ftp.6367428246.found.txt ../testdata/ftp.6367428246.expected.txt +#./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6367428246 > ../testdata/ftp.6367428246.found.txt && colordiff ../testdata/ftp.6367428246.found.txt ../testdata/ftp.6367428246.expected.txt -./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929537410 > ../testdata/ftp.6929537410.found.txt && colordiff ../testdata/ftp.6929537410.found.txt ../testdata/ftp.6929537410.expected.txt -./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929553738 > ../testdata/ftp.6929553738.found.txt && colordiff ../testdata/ftp.6929553738.found.txt ../testdata/ftp.6929553738.expected.txt +#./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929537410 > ../testdata/ftp.6929537410.found.txt && colordiff ../testdata/ftp.6929537410.found.txt ../testdata/ftp.6929537410.expected.txt +#./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929553738 > ../testdata/ftp.6929553738.found.txt && colordiff ../testdata/ftp.6929553738.found.txt ../testdata/ftp.6929553738.expected.txt #./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929572212 > ../testdata/ftp.6929572212.found.txt && colordiff ../testdata/ftp.6929572212.found.txt ../testdata/ftp.6929572212.expected.txt #./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929576743 > ../testdata/ftp.6929576743.found.txt && colordiff ../testdata/ftp.6929576743.found.txt ../testdata/ftp.6929576743.expected.txt #./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6929587483 > ../testdata/ftp.6929587483.found.txt && colordiff ../testdata/ftp.6929587483.found.txt ../testdata/ftp.6929587483.expected.txt echo "if everything was printed as expected this worked" -echo "todo: this doesnt verify correct gametype detection"