Exemplo n.º 1
0
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!")
Exemplo n.º 2
0
 def setUp(self):
     self.db = DB();
     
     league = "mlb"
     
     self.gamedayDirectory = GamedayDirectoryStructure(GamedayConfig.mlbGamedayApplicationURL, league)
     
     self.performanceFileName = "./performance.log"
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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!")
Exemplo n.º 5
0
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();
Exemplo n.º 7
0
 def setUp(self):
     self.db = DB();
Exemplo n.º 8
0
def create():
    db = DB()
    
    createMLB(db)
Exemplo n.º 9
0
 def produce(self):
     return LoadGame(DB())
Exemplo n.º 10
0
def create():
    db = DB()

    runNormalizeSQL(db)
    runUserDefinedSQL(db)
Exemplo n.º 11
0
def main():
    DB()
    def setUp(self):
        self.db = DB()

        self.gameStatsWorkList = GameStatsWorkList()