some datetime tests for stars

This commit is contained in:
Matt Turnbull 2009-03-29 12:20:04 +01:00
parent d079fea634
commit 4bccc0fd28

View File

@ -41,3 +41,38 @@ def testGameInfo():
for (header, info) in pairs:
yield checkGameInfo, hhc, header, info
def testHandInfo():
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)
assert h.handid == '20461877044'
assert h.sitename == 'PokerStars'
assert h.starttime == (2008, 9, 16, 18, 58, 1, 1, 260, -1)
text = u"""PokerStars Game #18707234955: Razz Limit ($0.50/$1.00) - 2008/07/09 - 21:41:43 (ET)
Table 'Lepus II' 8-max"""
hhc = PokerStarsToFpdb.PokerStars(autostart=False)
h = HoldemOmahaHand(None, "PokerStars", gametype, text, builtFrom = "Test")
hhc.readHandInfo(h)
assert h.handid == '18707234955'
assert h.sitename == 'PokerStars'
assert h.maxseats == 8
assert h.tablename == 'Lepus II'
assert h.starttime == (2008,7 , 9, 21, 41, 43, 2, 191, -1)
text = u"""PokerStars Game #22073591924: Hold'em No Limit ($0.50/$1.00) - 2008/11/16 1:22:21 CET [2008/11/15 19:22:21 ET]
Table 'Caia II' 6-max Seat #2 is the button"""
hhc = PokerStarsToFpdb.PokerStars(autostart=False)
h = HoldemOmahaHand(None, "PokerStars", gametype, text, builtFrom = "Test")
hhc.readHandInfo(h)
assert h.handid == '22073591924'
assert h.sitename == 'PokerStars'
assert h.maxseats == 6
assert h.tablename == 'Caia II'
assert h.buttonpos == '2' # TODO: should this be an int?
assert h.starttime == (2008,11 , 15, 19, 22, 21, 5, 320, -1)