From ed3b09967d73b6c222c7455abc109815def10488 Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Wed, 1 Apr 2009 23:28:48 +0100 Subject: [PATCH] test_PokerStars typo, test_fpdb_simple uncommented some stuff and made it work in pytest --- pyfpdb/test_PokerStars.py | 4 ++-- pyfpdb/test_fpdb_simple.py | 37 ++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/pyfpdb/test_PokerStars.py b/pyfpdb/test_PokerStars.py index 4db7b3b2..454ee8d2 100644 --- a/pyfpdb/test_PokerStars.py +++ b/pyfpdb/test_PokerStars.py @@ -46,7 +46,7 @@ def testGameInfo(): def testHandInfo(): - text = u""""PokerStars Game #20461877044: Hold'em No Limit ($1/$2) - 2008/09/16 18:58:01 ET""" + text = u"""PokerStars Game #20461877044: Hold'em No Limit ($1/$2) - 2008/09/16 18:58:01 ET""" hhc = PokerStarsToFpdb.PokerStars(autostart=False) h = HoldemOmahaHand(None, "PokerStars", gametype, text, builtFrom = "Test") hhc.readHandInfo(h) @@ -78,4 +78,4 @@ Table 'Caia II' 6-max Seat #2 is the button""" assert h.buttonpos == '2' # TODO: should this be an int? assert h.starttime == (2008,11 , 15, 19, 22, 21, 5, 320, -1) - \ No newline at end of file + diff --git a/pyfpdb/test_fpdb_simple.py b/pyfpdb/test_fpdb_simple.py index af741508..463e704e 100755 --- a/pyfpdb/test_fpdb_simple.py +++ b/pyfpdb/test_fpdb_simple.py @@ -16,25 +16,24 @@ def testPokerStarsHHDate(): datetime.datetime(2008,9,7,11,23,14)) ) -#def testFullTiltHHDate(self): -# sitngo1 = "Full Tilt Poker Game #10311865543: $1 + $0.25 Sit & Go (78057629), Table 1 - 25/50 - No Limit Hold'em - 0:07:45 ET - 2009/01/29" -# cash1 = "Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09" -# cash2 = "Full Tilt Poker Game #9468383505: Table Bike (deep 6) - $0.05/$0.10 - No Limit Hold'em - 5:09:36 ET - 2008/12/13" +def testFullTiltHHDate(): + sitngo1 = "Full Tilt Poker Game #10311865543: $1 + $0.25 Sit & Go (78057629), Table 1 - 25/50 - No Limit Hold'em - 0:07:45 ET - 2009/01/29" + cash1 = "Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09" + cash2 = "Full Tilt Poker Game #9468383505: Table Bike (deep 6) - $0.05/$0.10 - No Limit Hold'em - 5:09:36 ET - 2008/12/13" -# result = fpdb_simple.parseHandStartTime(sitngo1,"ftp") -# self.failUnless(result==datetime.datetime(2009,1,29,05,07,45), -# "Date incorrect, expected: 2009-01-29 05:07:45 got: " + str(result)) -# result = fpdb_simple.parseHandStartTime(cash1,"ftp") -# self.failUnless(result==datetime.datetime(2008,12,9,14,40,20), -# "Date incorrect, expected: 2008-12-09 14:40:20 got: " + str(result)) -# result = fpdb_simple.parseHandStartTime(cash2,"ftp") -# self.failUnless(result==datetime.datetime(2008,12,13,10,9,36), -# "Date incorrect, expected: 2008-12-13 10:09:36 got: " + str(result)) + result = fpdb_simple.parseHandStartTime(sitngo1,"ftp") + assert result==datetime.datetime(2009,1,29,05,07,45) + result = fpdb_simple.parseHandStartTime(cash1,"ftp") + assert result==datetime.datetime(2008,12,9,14,40,20) + result = fpdb_simple.parseHandStartTime(cash2,"ftp") + assert result==datetime.datetime(2008,12,13,10,9,36) -# def testTableDetection(self): -# result = Tables.clean_title("French (deep)") -# self.failUnless(result == "French", "French (deep) parsed incorrectly. Expected 'French' got: " + str(result)) -# result = ("French (deep) - $0.25/$0.50 - No Limit Hold'em - Logged In As xxxx") + def testTableDetection(): + result = Tables.clean_title("French (deep)") + assert result == "French" + result = Tables.clean_title("French (deep) - $0.25/$0.50 - No Limit Hold'em - Logged In As xxxx") + assert result == "French" + + for (header, site, result) in tuples: + yield checkDateParse, header, site, result - for (header, site, result) in tuples: - yield checkDateParse, header, site, result