예제 #1
0
 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)
예제 #2
0
 def setUp(self):
     self.arxiv = Arxiv(app=self.app)
예제 #3
0
 def test_double_creation(self):
     Arxiv(app=self.app)
     self.assertRaises(RuntimeError, Arxiv, app=self.app)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 def test_creation(self):
     assert "arxiv" not in self.app.extensions
     Arxiv(app=self.app)
     assert isinstance(self.app.extensions["arxiv"], Arxiv)