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