THP + test config: Add suppor for Carbon

Make THP script more robust when testing stats
This commit is contained in:
Worros 2010-09-03 14:31:52 +08:00
parent 08c8315cd0
commit c5412caa14
2 changed files with 14 additions and 7 deletions

View File

@ -575,6 +575,7 @@ Left-Drag to Move"
<hhc site="Betfair" converter="BetfairToFpdb"/>
<hhc site="OnGame" converter="OnGameToFpdb"/>
<hhc site="Partouche" converter="PartoucheToFpdb"/>
<hhc site="Carbon" converter="CarbonToFpdb"/>
</hhcs>
<supported_databases>

View File

@ -85,12 +85,15 @@ def compare(leaf, importer, errors, site):
for stat in pstat:
#print "pstat[%s][%s]: %s == %s" % (p, stat, pstat[stat], teststat[stat])
try:
if pstat[stat] == teststat[stat]:
# The stats match - continue
pass
else:
# Stats don't match - Doh!
errors.error_report(filename, hand, stat, ghash, testhash, p)
except KeyError, e:
errors.error_report(filename, False, "KeyError: '%s'" % stat, False, False, p)
if errs > 0:
errors.error_report(filename, False, "Parse", False, False, False)
@ -134,6 +137,7 @@ def main(argv=None):
OnGameErrors = FpdbError('OnGame')
AbsoluteErrors = FpdbError('Absolute Poker')
EverleafErrors = FpdbError('Everleaf Poker')
CarbonErrors = FpdbError('Carbon')
walk_testfiles("regression-test-files/cash/Stars/", compare, importer, PokerStarsErrors, "PokerStars")
walk_testfiles("regression-test-files/tour/Stars/", compare, importer, PokerStarsErrors, "PokerStars")
@ -145,8 +149,9 @@ def main(argv=None):
walk_testfiles("regression-test-files/cash/OnGame/", compare, importer, OnGameErrors, "OnGame")
walk_testfiles("regression-test-files/cash/Absolute/", compare, importer, AbsoluteErrors, "Absolute")
walk_testfiles("regression-test-files/cash/Everleaf/", compare, importer, EverleafErrors, "Everleaf")
walk_testfiles("regression-test-files/cash/Carbon/", compare, importer, CarbonErrors, "Carbon")
totalerrors = PokerStarsErrors.errorcount + FTPErrors.errorcount + PartyPokerErrors.errorcount + BetfairErrors.errorcount + OnGameErrors.errorcount + AbsoluteErrors.errorcount + EverleafErrors.errorcount
totalerrors = PokerStarsErrors.errorcount + FTPErrors.errorcount + PartyPokerErrors.errorcount + BetfairErrors.errorcount + OnGameErrors.errorcount + AbsoluteErrors.errorcount + EverleafErrors.errorcount + CarbonErrors.errorcount
print "---------------------"
print "Total Errors: %d" % totalerrors
@ -158,6 +163,7 @@ def main(argv=None):
OnGameErrors.print_histogram()
AbsoluteErrors.print_histogram()
EverleafErrors.print_histogram()
CarbonErrors.print_histogram()
if __name__ == '__main__':
sys.exit(main())