From ce5f6f1d7182a76213d2bc621f281c505959e34b Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 5 Oct 2008 06:22:31 +0100 Subject: [PATCH] p117 - fixed bug in HudCache generation that it stored L rather than E for position new blackbox regression testing data --- docs/known-bugs-and-planned-features.txt | 2 +- pyfpdb/fpdb_simple.py | 2 +- regression-test/PrintPlayerHudData.py | 3 +- .../ps-flags-B-1hands.expected.txt | 68 +++++++++++++++++++ regression-test/ps-flags-CBflop.expected.txt | 68 +++++++++++++++++++ .../ps-flags-M-2hands.expected.txt | 68 +++++++++++++++++++ regression-test/regression-test.sh | 8 ++- 7 files changed, 215 insertions(+), 4 deletions(-) create mode 100644 regression-test/ps-flags-B-1hands.expected.txt create mode 100644 regression-test/ps-flags-CBflop.expected.txt create mode 100644 regression-test/ps-flags-M-2hands.expected.txt diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index 718138a2..bd092291 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -17,7 +17,7 @@ update abbreviations.txt export settings[hud-defaultInterval] to conf fill check-/call-raise cache fields -printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring-successful-steal-by-cutoff.txt and ps-lhe-ring-call-3B-preflop-cb-no2b.txt +printplayerflags on ps-lhe-ring-successful-steal-by-cutoff.txt, finish existing regression tests change to savannah? implement steal and positions in stud anonymiser script to generate testdata without making a dozen find&replace all... remember to replace hand no with running no diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index a6fa7142..d80151b3 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1583,7 +1583,7 @@ def generateHudCacheData(player_ids, base, category, action_types, actionTypeByN elif pos>=2 and pos<=4: hudDataPositions.append('M') elif pos>=5 and pos<=7: - hudDataPositions.append('L') + hudDataPositions.append('E') ### RHH Added this elif to handle being a dead hand before the BB (pos==9) elif pos==9: hudDataPositions.append('X') diff --git a/regression-test/PrintPlayerHudData.py b/regression-test/PrintPlayerHudData.py index 351472b1..5b4b0599 100755 --- a/regression-test/PrintPlayerHudData.py +++ b/regression-test/PrintPlayerHudData.py @@ -29,7 +29,7 @@ parser.add_option("-e", "--seats", default="7", type="int", help="number of acti parser.add_option("-g", "--gameType", default="ring", help="Whether its a ringgame (ring) or a tournament (tour)") parser.add_option("-l", "--limit", "--limitType", default="fl", help="Limit Type, one of: nl, pl, fl, cn, cp") parser.add_option("-n", "--name", "--playername", default="Player_1", help="Name of the player to print") -parser.add_option("-o", "--position", default="B", help="Position, can be B, S, or a number between 0 and 7") +parser.add_option("-o", "--position", default="B", help="Position, can be B, S, D, C, M or E (see tabledesign.html)") parser.add_option("-p", "--password", help="The password for the MySQL user") parser.add_option("-s", "--site", default="PokerStars", help="Name of the site (as written in the history files)") @@ -54,6 +54,7 @@ cursor.execute("SELECT id FROM Players WHERE name=%s", (options.name,)) playerId=cursor.fetchone()[0] cursor.execute("SELECT id FROM HudCache WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s",(gametypeId, playerId, options.seats, options.position)) +#print "debug: gametypeId:", gametypeId, "playerId:", playerId, "options.seats:", options.seats, "options.position:", options.position hudDataId=cursor.fetchone()[0] print "siteId:", siteId, "gametypeId:", gametypeId, "playerId:", playerId, "hudDataId:", hudDataId diff --git a/regression-test/ps-flags-B-1hands.expected.txt b/regression-test/ps-flags-B-1hands.expected.txt new file mode 100644 index 00000000..9b134e91 --- /dev/null +++ b/regression-test/ps-flags-B-1hands.expected.txt @@ -0,0 +1,68 @@ +Connected to MySQL on localhost. Print Player Flags Utility + +Basic Data +========== +bigblind: 2 category: holdem limitType: fl name: Player_5 gameType: ring site: PokerStars +siteId: 2 gametypeId: 1 playerId: 5 hudDataId: 12 + +HUD Raw Hand Counts +=================== +HDs: 1 +street0VPI: 0 +street0Aggr: 0 +street0_3B4BChance: 0 +street0_3B4BDone: 0 + +street1Seen: 1 +street2Seen: 1 +street3Seen: 1 +street4Seen: 0 +sawShowdown: 1 + +street1Aggr: 1 +street2Aggr: 1 +street3Aggr: 0 +street4Aggr: 0 + +otherRaisedStreet1: 0 +otherRaisedStreet2: 1 +otherRaisedStreet3: 1 +otherRaisedStreet4: 0 +foldToOtherRaisedStreet1: 0 +foldToOtherRaisedStreet2: 0 +foldToOtherRaisedStreet3: 0 +foldToOtherRaisedStreet4: 0 + +wonWhenSeenStreet1: 0 +wonAtSD: 0 +stealAttemptChance: 0 +stealAttempted: 0 +foldBbToStealChance: 0 +foldedBbToSteal: 0 +foldSbToStealChance: 0 +foldedSbToSteal: 0 +street1CBChance: 0 +street1CBDone: 0 +street2CBChance: 0 +street2CBDone: 0 +street3CBChance: 0 +street3CBDone: 0 +street4CBChance: 0 +street4CBDone: 0 +foldToStreet1CBChance: 0 +foldToStreet1CBDone: 0 +foldToStreet2CBChance: 0 +foldToStreet2CBDone: 0 +foldToStreet3CBChance: 0 +foldToStreet3CBDone: 0 +foldToStreet4CBChance: 0 +foldToStreet4CBDone: 0 +totalProfit: +street1CheckCallRaiseChance: +street1CheckCallRaiseDone: +street2CheckCallRaiseChance: +street2CheckCallRaiseDone: +street3CheckCallRaiseChance: +street3CheckCallRaiseDone: +street4CheckCallRaiseChance: 0 +street4CheckCallRaiseDone: 0 diff --git a/regression-test/ps-flags-CBflop.expected.txt b/regression-test/ps-flags-CBflop.expected.txt new file mode 100644 index 00000000..7fea235d --- /dev/null +++ b/regression-test/ps-flags-CBflop.expected.txt @@ -0,0 +1,68 @@ +Connected to MySQL on localhost. Print Player Flags Utility + +Basic Data +========== +bigblind: 25 category: holdem limitType: fl name: player3 gameType: ring site: PokerStars +siteId: 2 gametypeId: 2 playerId: 11 hudDataId: 22 + +HUD Raw Hand Counts +=================== +HDs: 1 +street0VPI: 1 +street0Aggr: 1 +street0_3B4BChance: 1 +street0_3B4BDone: 1 + +street1Seen: 1 +street2Seen: 1 +street3Seen: 1 +street4Seen: 0 +sawShowdown: 1 + +street1Aggr: 1 +street2Aggr: 0 +street3Aggr: 0 +street4Aggr: 0 + +otherRaisedStreet1: 0 +otherRaisedStreet2: +otherRaisedStreet3: +otherRaisedStreet4: 0 +foldToOtherRaisedStreet1: 0 +foldToOtherRaisedStreet2: 0 +foldToOtherRaisedStreet3: 0 +foldToOtherRaisedStreet4: 0 + +wonWhenSeenStreet1: 0.0 +wonAtSD: 0.0 +stealAttemptChance: 0 +stealAttempted: 0 +foldBbToStealChance: 0 +foldedBbToSteal: 0 +foldSbToStealChance: 0 +foldedSbToSteal: 0 +street1CBChance: 1 +street1CBDone: 1 +street2CBChance: 0 +street2CBDone: 0 +street3CBChance: 0 +street3CBDone: 0 +street4CBChance: 0 +street4CBDone: 0 +foldToStreet1CBChance: 0 +foldToStreet1CBDone: 0 +foldToStreet2CBChance: 0 +foldToStreet2CBDone: 0 +foldToStreet3CBChance: 0 +foldToStreet3CBDone: 0 +foldToStreet4CBChance: 0 +foldToStreet4CBDone: 0 +totalProfit: +street1CheckCallRaiseChance: 0 +street1CheckCallRaiseDone: 0 +street2CheckCallRaiseChance: 0 +street2CheckCallRaiseDone: 0 +street3CheckCallRaiseChance: 0 +street3CheckCallRaiseDone: 0 +street4CheckCallRaiseChance: 0 +street4CheckCallRaiseDone: 0 diff --git a/regression-test/ps-flags-M-2hands.expected.txt b/regression-test/ps-flags-M-2hands.expected.txt new file mode 100644 index 00000000..aa55e1c5 --- /dev/null +++ b/regression-test/ps-flags-M-2hands.expected.txt @@ -0,0 +1,68 @@ +Connected to MySQL on localhost. Print Player Flags Utility + +Basic Data +========== +bigblind: 2 category: holdem limitType: fl name: Player_1 gameType: ring site: PokerStars +siteId: 2 gametypeId: 1 playerId: 1 hudDataId: 8 + +HUD Raw Hand Counts +=================== +HDs: 2 +street0VPI: 0 +street0Aggr: 0 +street0_3B4BChance: 0 +street0_3B4BDone: 0 + +street1Seen: 0 +street2Seen: 0 +street3Seen: 0 +street4Seen: 0 +sawShowdown: 0 + +street1Aggr: 0 +street2Aggr: 0 +street3Aggr: 0 +street4Aggr: 0 + +otherRaisedStreet1: 0 +otherRaisedStreet2: 0 +otherRaisedStreet3: 0 +otherRaisedStreet4: 0 +foldToOtherRaisedStreet1: 0 +foldToOtherRaisedStreet2: 0 +foldToOtherRaisedStreet3: 0 +foldToOtherRaisedStreet4: 0 + +wonWhenSeenStreet1: 0.0 +wonAtSD: 0.0 +stealAttemptChance: 0 +stealAttempted: 0 +foldBbToStealChance: 0 +foldedBbToSteal: 0 +foldSbToStealChance: 0 +foldedSbToSteal: 0 +street1CBChance: 0 +street1CBDone: 0 +street2CBChance: 0 +street2CBDone: 0 +street3CBChance: 0 +street3CBDone: 0 +street4CBChance: 0 +street4CBDone: 0 +foldToStreet1CBChance: 0 +foldToStreet1CBDone: 0 +foldToStreet2CBChance: 0 +foldToStreet2CBDone: 0 +foldToStreet3CBChance: 0 +foldToStreet3CBDone: 0 +foldToStreet4CBChance: 0 +foldToStreet4CBDone: 0 +totalProfit: 0 +street1CheckCallRaiseChance: 0 +street1CheckCallRaiseDone: 0 +street2CheckCallRaiseChance: 0 +street2CheckCallRaiseDone: 0 +street3CheckCallRaiseChance: 0 +street3CheckCallRaiseDone: 0 +street4CheckCallRaiseChance: 0 +street4CheckCallRaiseDone: 0 diff --git a/regression-test/regression-test.sh b/regression-test/regression-test.sh index 5e0cfb9d..5bf93149 100755 --- a/regression-test/regression-test.sh +++ b/regression-test/regression-test.sh @@ -30,7 +30,13 @@ echo "it should've reported first that it stored 3, then that it had 3 duplicate ./PrintHand.py -p$1 --hand=14519420999 > ps.14519420999.found.txt && colordiff ps.14519420999.found.txt ps.14519420999.expected.txt ./PrintHand.py -p$1 --hand=14519433154 > ps.14519433154.found.txt && colordiff ps.14519433154.found.txt ps.14519433154.expected.txt -./PrintPlayerHudData.py -p$1 > ps-flags-3hands.found.txt && colordiff ps-flags-3hands.found.txt ps-flags-3hands.expected.txt +./PrintPlayerHudData.py -p$1 -oM > ps-flags-M-2hands.found.txt && colordiff ps-flags-M-2hands.found.txt ps-flags-M-2hands.expected.txt +./PrintPlayerHudData.py -p$1 -nPlayer_5 -oB > ps-flags-B-1hands.found.txt && colordiff ps-flags-B-1hands.found.txt ps-flags-B-1hands.expected.txt + + +../pyfpdb/fpdb_import.py -p$1 --file=ps-lhe-ring-call-3B-preflop-cb-no2b.txt -x +echo "it should've now reported another successful store of 1 hand" +./PrintPlayerHudData.py -p$1 -nplayer3 -oE -e10 -b25 > ps-flags-CBflop.found.txt && colordiff ps-flags-CBflop.found.txt ps-flags-CBflop.expected.txt #./print_hand.py -p$1 --site="Full Tilt Poker" --hand=6367428246 > ftp.6367428246.found.txt && colordiff ftp.6367428246.found.txt ftp.6367428246.expected.txt