diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index ce6061ae..19bf18d1 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -99,7 +99,7 @@ class Importer: for i in xrange(self.settings['threads']): self.writerdbs.append( Database.Database(self.config, sql = self.sql) ) - self.NEWIMPORT = False + self.NEWIMPORT = Configuration.NEWIMPORT #Set functions def setCallHud(self, value): diff --git a/pyfpdb/test_PokerStars.py b/pyfpdb/test_PokerStars.py index 94370b5f..6c97c2d4 100644 --- a/pyfpdb/test_PokerStars.py +++ b/pyfpdb/test_PokerStars.py @@ -97,16 +97,29 @@ def testStudImport(): (stored, dups, partial, errs, ttime) = importer.runImport() importer.clearFileList() + # Should actually do some testing here + assert 1 == 1 + def testDrawImport(): - 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/Stars/Draw/3-Draw-Limit-USD-0.10-0.20-200911.txt""", site="PokerStars") - importer.addBulkImportImportFileOrDir( - """regression-test-files/cash/Stars/Draw/5-Carddraw-USD-0.10-0.20-200911.txt""", site="PokerStars") - importer.setCallHud(False) - (stored, dups, partial, errs, ttime) = importer.runImport() - importer.clearFileList() + try: + 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/Stars/Draw/3-Draw-Limit-USD-0.10-0.20-200911.txt""", site="PokerStars") + importer.addBulkImportImportFileOrDir( + """regression-test-files/cash/Stars/Draw/5-Carddraw-USD-0.10-0.20-200911.txt""", site="PokerStars") + importer.setCallHud(False) + (stored, dups, partial, errs, ttime) = importer.runImport() + importer.clearFileList() + except FpdbError: + if Configuration.NEWIMPORT == False: + #Old import code doesn't support draw + pass + else: + assert 0 == 1 + + # Should actually do some testing here + assert 1 == 1