Пример #1
0
def test_install_already_installed(mock1, mock2, mock3):
    transaction = ReadWriteTransaction(Mock(), Mock())
    transaction.install()

    assert mock1.not_called()
    assert mock2.not_called()
    mock3.assert_called()
def test_install_already_installed(mock1, mock2, mock3):
    transaction = ReadWriteTransaction(Mock(), Mock())
    transaction.install()

    assert mock1.not_called()
    assert mock2.not_called()
    mock3.assert_called()
Пример #3
0
def trans(request):
    dsn = make_dsn_from_env(os.environ)
    connection = psycopg2.connect(dsn)
    transaction = ReadWriteTransaction(connection, Node)

    if transaction.is_installed():
        transaction.uninstall()

    node_ids.clear()
    transaction.install()
    transaction.commit()

    def fin():
        transaction.uninstall()
        transaction.commit()
    request.addfinalizer(fin)

    return transaction
Пример #4
0
def trans(request):
    dsn = make_dsn_from_env(os.environ)
    connection = psycopg2.connect(dsn)
    transaction = ReadWriteTransaction(connection, Node)

    if transaction.is_installed():
        transaction.uninstall()

    node_ids.clear()
    transaction.install()
    transaction.commit()

    def fin():
        transaction.uninstall()
        transaction.commit()

    request.addfinalizer(fin)

    return transaction
Пример #5
0
def test_install(mock1, mock2, mock3):
    transaction = ReadWriteTransaction(Mock(), Mock())
    transaction.install()
    mock1.assert_called_with(transaction.cursor)
    mock2.assert_called_with(transaction.cursor)
    mock3.assert_called()
def test_install(mock1, mock2, mock3):
    transaction = ReadWriteTransaction(Mock(), Mock())
    transaction.install()
    mock1.assert_called_with(transaction.cursor)
    mock2.assert_called_with(transaction.cursor)
    mock3.assert_called()