コード例 #1
0
 def test_with_session(self):
     assert get_bind(self.session) == self.connection
コード例 #2
0
 def test_with_unknown_type(self):
     with raises(TypeError):
         get_bind(None)
コード例 #3
0
 def test_with_model_object(self):
     article = self.Article()
     self.session.add(article)
     assert get_bind(article) == self.connection
コード例 #4
0
 def test_with_connection(self, session, connection):
     assert get_bind(connection) == connection
コード例 #5
0
 def test_with_unknown_type(self):
     with pytest.raises(TypeError):
         get_bind(None)
コード例 #6
0
 def test_with_model_object(self, session, connection, Article):
     article = Article()
     session.add(article)
     assert get_bind(article) == connection