diff --git a/tests/test_routes.py b/tests/test_routes.py new file mode 100644 index 0000000..a498db9 --- /dev/null +++ b/tests/test_routes.py @@ -0,0 +1,34 @@ +import unittest +from app import create_app, db +from app.models import Player, Game, Role, GamePlayer, Objective, ObjectiveMinimalEncoder, LocationEncoder +from config import Config + +class TestConfig(Config): + TESTING = True + SQLALCHEMY_DATABASE_URI = 'sqlite://' + +class RoutesCase(unittest.TestCase): + def setUp(self): + self.app = create_app(TestConfig) + self.app_context = self.app.app_context() + self.app_context.push() + db.create_all() + + def tearDown(self): + db.session.remove() + db.drop_all() + self.app_context.pop() + + def test_is_game_owner(self): + g = Game(name='TestGame') + p1 = Player(name='Henk') + p2 = Player(name='Alfred') + g.players.append(p1) + g.players.append(p2) + db.session.append(g) + db.session.commit() + self.assertEqual + self.assertFalse('Foo'.isupper()) + +if __name__ == '__main__': + unittest.main(verbosity=2) \ No newline at end of file