-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtests.py
55 lines (40 loc) · 1.29 KB
/
tests.py
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
55
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import gc
import os
import sys
import tempfile
import unittest
from supersqlite import pysqlite, apsw, SQLITE_LIB, APSW_LIB, SuperSQLite
def _clear_mmap():
os.system("rm -rf " + os.path.join(tempfile.gettempdir(), '*.supersqlmmap'))
os.system(
"rm -rf " +
os.path.join(
tempfile.gettempdir(),
'*.supersqlmmap*'))
class MagnitudeTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
gc.collect()
def test_sqlite_lib(self):
self.assertEqual(SQLITE_LIB, 'internal')
def test_apsw_lib(self):
self.assertEqual(APSW_LIB, 'internal')
def test_pysqlite(self):
self.assertTrue(pysqlite)
def test_apsw(self):
self.assertTrue(apsw)
def test_ssqlite_subclass(self):
self.assertTrue(issubclass(SuperSQLite.Connection, apsw.Connection))
self.assertTrue(issubclass(SuperSQLite.connect, apsw.Connection))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('unittest_args', nargs='*')
args = parser.parse_args()
_clear_mmap()
unittest.main(argv=[sys.argv[0]] + args.unittest_args)