def test_creation_init(self): assert "arxiv" not in self.app.extensions r = Arxiv() r.init_app(app=self.app) assert isinstance(self.app.extensions["arxiv"], Arxiv)
def setUp(self): self.arxiv = Arxiv(app=self.app)
def test_double_creation(self): Arxiv(app=self.app) self.assertRaises(RuntimeError, Arxiv, app=self.app)
def test_creation_old_flask(self): # Simulate old Flask (pre 0.9) del self.app.extensions Arxiv(app=self.app) assert isinstance(self.app.extensions["arxiv"], Arxiv)
def test_creation(self): assert "arxiv" not in self.app.extensions Arxiv(app=self.app) assert isinstance(self.app.extensions["arxiv"], Arxiv)