File: test_sqlalchemy_sqlite.py

package info (click to toggle)
rdflib-sqlalchemy 0.5.4%2Bgit99f4689-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,544 kB
  • sloc: python: 2,418; sh: 20; makefile: 3
file content (54 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download
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()