1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
import logging
import os
import unittest
import pytest
from rdflib import Literal
from . import context_case
from . import graph_case
if os.environ.get("DB") != "sqlite":
pytest.skip("SQLite not under test", allow_module_level=True)
_logger = logging.getLogger(__name__)
sqlalchemy_url = Literal(os.environ.get("DBURI", "sqlite://"))
class SQLASQLiteGraphTestCase(graph_case.GraphTestCase):
storetest = True
storename = "SQLAlchemy"
uri = sqlalchemy_url
def setUp(self):
super(SQLASQLiteGraphTestCase, self).setUp(
uri=self.uri, storename=self.storename)
def tearDown(self):
super(SQLASQLiteGraphTestCase, self).tearDown(uri=self.uri)
class SQLASQLiteContextTestCase(context_case.ContextTestCase):
storetest = True
storename = "SQLAlchemy"
uri = sqlalchemy_url
def setUp(self):
super(SQLASQLiteContextTestCase, self).setUp(
uri=self.uri, storename=self.storename)
def tearDown(self):
super(SQLASQLiteContextTestCase, self).tearDown(uri=self.uri)
def testLenInMultipleContexts(self):
pytest.skip("Known issue.")
SQLASQLiteGraphTestCase.storetest = True
SQLASQLiteContextTestCase.storetest = True
if __name__ == "__main__":
unittest.main()
|