コード例 #1
0
ファイル: vhost_mail_test.py プロジェクト: karenytu/ocfweb
def test_txn_rolls_back_and_raises_on_failure(fake_cursor):
    with pytest.raises(ValueError):
        with _txn():
            raise ValueError('lol sup')
    fake_cursor.connection.rollback.assert_called_once_with()
    assert not fake_cursor.connection.commit.called
コード例 #2
0
ファイル: vhost_mail_test.py プロジェクト: tmochida/ocfweb
def test_txn_rolls_back_and_raises_on_failure(fake_cursor):
    with pytest.raises(ValueError):
        with _txn():
            raise ValueError('lol sup')
    fake_cursor.connection.rollback.assert_called_once()
    assert not fake_cursor.connection.commit.called
コード例 #3
0
ファイル: vhost_mail_test.py プロジェクト: karenytu/ocfweb
def test_txn_commits_on_success(fake_cursor):
    with _txn():
        pass
    fake_cursor.connection.commit.assert_called_once_with()
    assert not fake_cursor.connection.rollback.called
コード例 #4
0
ファイル: vhost_mail_test.py プロジェクト: tmochida/ocfweb
def test_txn_commits_on_success(fake_cursor):
    with _txn():
        pass
    fake_cursor.connection.commit.assert_called_once()
    assert not fake_cursor.connection.rollback.called