summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Willison <swillison@gmail.com>2019-11-12 08:15:24 -0800
committerNed Batchelder <ned@nedbatchelder.com>2019-11-12 21:06:57 -0500
commitb5c69bd598d31173695453cedb18211e292ec777 (patch)
treed2d5ea41ec7dd48e03b2586af62a7b6272b5efb4 /tests
parent09adf5d4b238cc1443b4ae7fcdfe34997cfcf00a (diff)
downloadpython-coveragepy-git-b5c69bd598d31173695453cedb18211e292ec777.tar.gz
Expose numbits_to_nums() SQL function, refs #868
Diffstat (limited to 'tests')
-rw-r--r--tests/test_numbits.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_numbits.py b/tests/test_numbits.py
index eb094d2a..232d48d3 100644
--- a/tests/test_numbits.py
+++ b/tests/test_numbits.py
@@ -3,6 +3,7 @@
"""Tests for coverage.numbits"""
+import json
import sqlite3
from hypothesis import example, given, settings
@@ -156,3 +157,7 @@ class NumbitsSqliteFunctionTest(CoverageTest):
res = self.cursor.execute("select id, num_in_numbits(12, numbits) from data order by id")
answer = [is_in for (id, is_in) in res]
self.assertEqual([1, 1, 1, 1, 0, 1, 0, 0, 0, 0], answer)
+
+ def test_numbits_to_nums(self):
+ res = self.cursor.execute("select numbits_to_nums(?)", [nums_to_numbits([1, 2, 3])])
+ self.assertEqual([1, 2, 3], json.loads(res.fetchone()[0]))