Esempio n. 1
0
MoinMoin - store test magic
"""

from __future__ import absolute_import, division

import pytest
from ..wrappers import ByteToStreamWrappingStore

from MoinMoin._tests import check_connection

STORES_PACKAGE = 'MoinMoin.storage.stores'

STORES = 'fs kc memory sqlite sqlite:compressed sqla'.split()
try:
    # check if we can connect to the kt server
    check_connection(1978)
    STORES.append('kt')
except Exception:
    pass

try:
    # check if we can connect to the mongodb server
    check_connection(27017)
    STORES.append('mongodb')
except Exception:
    pass

constructors = {
    'memory':
    lambda store, _: store(),
    'fs':
Esempio n. 2
0
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - kyoto tycoon store tests
"""


from __future__ import absolute_import, division

import pytest
pytest.importorskip('MoinMoin.storage.stores.kt')


from MoinMoin._tests import check_connection
try:
    check_connection(1978)
except Exception as err:
    pytest.skip(str(err))


from ..kt import BytesStore, FileStore


@pytest.mark.multi(Store=[BytesStore, FileStore])
def test_create(Store):
    store = Store()
    store.create()
    return store


@pytest.mark.multi(Store=[BytesStore, FileStore])
Esempio n. 3
0
"""


from __future__ import absolute_import, division

import pytest
from ..wrappers import ByteToStreamWrappingStore

from MoinMoin._tests import check_connection

STORES_PACKAGE = 'MoinMoin.storage.stores'

STORES = 'fs kc memory sqlite sqlite:compressed sqla'.split()
try:
    # check if we can connect to the kt server
    check_connection(1978)
    STORES.append('kt')
except Exception:
    pass

try:
    # check if we can connect to the mongodb server
    check_connection(27017)
    STORES.append('mongodb')
except Exception:
    pass

constructors = {
    'memory': lambda store, _: store(),
    'fs': lambda store, tmpdir: store(str(tmpdir.join('store'))),
    'sqlite': lambda store, tmpdir: store(str(tmpdir.join('store.sqlite')), 'test_table', compression_level=0),
Esempio n. 4
0
# Copyright: 2011 MoinMoin:RonnyPfannschmidt
# Copyright: 2011 MoinMoin:ThomasWaldmann
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
"""
MoinMoin - kyoto tycoon store tests
"""

from __future__ import absolute_import, division

import pytest
pytest.importorskip('MoinMoin.storage.stores.kt')

from MoinMoin._tests import check_connection
try:
    check_connection(1978)
except Exception as err:
    pytest.skip(str(err))

from ..kt import BytesStore, FileStore


@pytest.mark.multi(Store=[BytesStore, FileStore])
def test_create(Store):
    store = Store()
    store.create()
    return store


@pytest.mark.multi(Store=[BytesStore, FileStore])
def test_destroy(Store):
    store = Store()
Esempio n. 5
0
# Copyright: 2011 MoinMoin:RonnyPfannschmidt
# Copyright: 2012 Ionut Artarisi <*****@*****.**>
# Copyright: 2012 MoinMoin:ThomasWaldmann
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - mongodb store tests
"""

import pytest
pytest.importorskip('MoinMoin.storage.stores.mongodb')
from ..mongodb import BytesStore, FileStore

from MoinMoin._tests import check_connection
try:
    check_connection(27017)
except Exception as err:
    pytest.skip(str(err))


@pytest.mark.multi(Store=[BytesStore, FileStore])
def test_create(Store):
    store = Store()
    store.create()
    return store


@pytest.mark.multi(Store=[BytesStore, FileStore])
def test_destroy(Store):
    store = Store()
    store.destroy()