def main(): options = commandLineOptionsParser.parseDeleteOptions() logging.info("Starting delete!") league = options.league gamedayDirectory = GamedayDirectoryStructure(BBOSConfig.gamedayURL, league) if not options.game: logging.error( "delete only accepts league and -g gameName as parameters") gamedayGameURLs = gamedayDirectory.getGameURLsForGame(options.game) xmlProvider = GamedayXMLProvider(gamedayGameURLs[0]) db = DB() gameStatsWorkList = GameStatsWorkList() gameLoader = GamedayGameLoader(db, xmlProvider, gameStatsWorkList) gameLoader.delete() logging.info("") logging.info("delete complete!")
def setUp(self): self.db = DB(); league = "mlb" self.gamedayDirectory = GamedayDirectoryStructure(GamedayConfig.mlbGamedayApplicationURL, league) self.performanceFileName = "./performance.log"
class mySQLConnectionFTest(FTest): def setUp(self): self.db = DB() def testLoad_SQLError(self): statement = """INSERT blah blah blah into gameday.atbats (gameName , inning, b, eventNumber, des, pitcher, o, s, num, batter, stand, event, halfInning) VALUES ("gid_2007_04_12_anamlb_clemlb_1", "2", "0", "7", "Garret Anderson grounds out, first baseman Casey Blake to pitcher Jeremy Sowers. ", "460265", "1", "2", "7", "110236", "L", "Ground Out", "top");""" try: self.db.execute(statement) self.fail("bad SQL should throw") except SQLException: pass def testLoad_SQLWarning(self): statement = """INSERT into gameday.gameConditions (gameName , windMPH, temperature, attendence, gameLength, forecast, windDirection) VALUES ("gid_2007_04_12_seamlb_bosmlb_1", "299999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999996", "38", "", "", "rain", "Out to LF");""" try: self.db.execute(statement) self.fail("bad SQL should throw truncate column size warning") except SQLException: pass
class DBFTest(FTest): def setUp(self): self.db = DB() def testConnection(self): logging.info("connected!") def testSelect(self): sql = "select * from information_schema.character_sets" results = self.db.select(sql) self.assertTrue(len(results) > 0) logging.info("selected!")
class DBFTest(FTest): def setUp(self): self.db = DB(); def testConnection(self): logging.info( "connected!" ) def testSelect(self): sql = "select * from information_schema.character_sets" results = self.db.select(sql) self.assertTrue(len(results) > 0) logging.info( "selected!" )
def setUp(self): self.db = DB();
def create(): db = DB() createMLB(db)
def produce(self): return LoadGame(DB())
def create(): db = DB() runNormalizeSQL(db) runUserDefinedSQL(db)
def main(): DB()
def setUp(self): self.db = DB() self.gameStatsWorkList = GameStatsWorkList()