2010-07-08 20:01:03 +02:00
|
|
|
#!/usr/bin/python
|
2009-03-12 12:01:41 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2010-07-04 03:05:16 +02:00
|
|
|
|
|
|
|
#Copyright 2009-2010 Carl Gherardi
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU Affero General Public License as published by
|
|
|
|
#the Free Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU Affero General Public License
|
|
|
|
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#In the "official" distribution you can find the license in agpl-3.0.txt.
|
|
|
|
|
2009-03-12 12:01:41 +01:00
|
|
|
import BetfairToFpdb
|
2009-12-03 10:45:04 +01:00
|
|
|
from Hand import *
|
2009-03-12 12:01:41 +01:00
|
|
|
import py
|
|
|
|
|
2009-12-03 10:45:04 +01:00
|
|
|
import Configuration
|
|
|
|
import Database
|
|
|
|
import SQL
|
|
|
|
import fpdb_import
|
2009-03-12 12:01:41 +01:00
|
|
|
|
2009-12-03 10:45:04 +01:00
|
|
|
config = Configuration.Config(file = "HUD_config.test.xml")
|
|
|
|
db = Database.Database(config)
|
|
|
|
sql = SQL.Sql(db_server = 'sqlite')
|
2009-03-12 12:01:41 +01:00
|
|
|
|
2009-12-03 10:45:04 +01:00
|
|
|
settings = {}
|
|
|
|
settings.update(config.get_db_parameters())
|
|
|
|
settings.update(config.get_import_parameters())
|
|
|
|
settings.update(config.get_default_paths())
|
2009-03-12 12:01:41 +01:00
|
|
|
|
2009-12-03 10:45:04 +01:00
|
|
|
def testFlopImport():
|
|
|
|
db.recreate_tables()
|
|
|
|
importer = fpdb_import.Importer(False, settings, config)
|
|
|
|
importer.setDropIndexes("don't drop")
|
|
|
|
importer.setFailOnError(True)
|
|
|
|
importer.setThreads(-1)
|
|
|
|
importer.addBulkImportImportFileOrDir(
|
|
|
|
"""regression-test-files/cash/Betfair/Flop/PLO-6max-USD-0.05-0.10-200909.All.in.river.splitpot.txt""", site="Betfair")
|
|
|
|
importer.setCallHud(False)
|
|
|
|
(stored, dups, partial, errs, ttime) = importer.runImport()
|
|
|
|
importer.clearFileList()
|
|
|
|
|
|
|
|
# Should actually do some testing here
|
|
|
|
assert 1 == 1
|