Beispiel #1
0
 def test_load(self):
     from pypitches import select_gamedirs
     from pypitches import load
     select_gamedirs.classify_local_dirs_by_filesystem(static_dir)
     load.load()
     self.assertEqual(self.session.query(Game).count(), 3)
     self.session.commit()
Beispiel #2
0
    def setUp(self):
        initdb(postgres_test_db, postgres_user, postgres_password)
        self.session = model.SessionManager.create(postgres_test_db, postgres_user, postgres_password) 

        from pypitches import select_gamedirs
        from pypitches import load
        select_gamedirs.classify_local_dirs_by_filesystem(static_dir)
        try:
            load.load()
        except IntegrityError:
            import pdb
            pdb.set_trace()
        self.assertEqual(self.session.query(Game).count(), 3)
Beispiel #3
0
 def test_classify(self):
     from pypitches import select_gamedirs
     select_gamedirs.classify_local_dirs_by_filesystem(static_dir)
     self.assertEqual(self.session.query(GameDir).count(), 4)
     self.assertEqual(self.session.query(GameDir).filter(GameDir.status=='postponed').count(), 1)