Mercurial > code > home > repos > homeauto
changeset 1666:4fd9fdfcf16a
clean up dead tests
author | drewp@bigasterisk.com |
---|---|
date | Mon, 20 Sep 2021 23:20:46 -0700 |
parents | 82ddd3e6b227 |
children | a2347393b43e |
files | service/mqtt_to_rdf/inference_test.py service/mqtt_to_rdf/lhs_evaluation_test.py |
diffstat | 2 files changed, 0 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference_test.py Mon Sep 20 23:19:40 2021 -0700 +++ b/service/mqtt_to_rdf/inference_test.py Mon Sep 20 23:20:46 2021 -0700 @@ -390,28 +390,3 @@ # inf = makeInferenceWithRules("{ :a :b (:e0 :e1 :e2 :e3) . } => { :new :stmt :here } .") # implied = inf.infer(N3(":a :b (:e0 :e1 :e2 :e3) .")) # self.assertGraphEqual(implied, N3(":new :stmt :here .")) - - -# def fakeStats(): -# return defaultdict(lambda: 0) - -# class TestLhsFindCandidateBindings(WithGraphEqual): - -# def testBnodeMatchesStmt(self): -# l = Lhs(N3("[] :a :b .")) -# ws = ReadOnlyGraphAggregate([N3("[] :a :b .")]) -# cands = list(l.findCandidateBindings(ws, fakeStats())) -# self.assertEqual(len(cands), 1) - -# def testVarMatchesStmt(self): -# l = Lhs(N3("?x :a :b .")) -# ws = ReadOnlyGraphAggregate([N3("[] :a :b .")]) -# cands = list(l.findCandidateBindings(ws, fakeStats())) -# self.assertEqual(len(cands), 1) - -# def testListsOnlyMatchEachOther(self): -# l = Lhs(N3(":a :b (:e0 :e1) .")) -# ws = ReadOnlyGraphAggregate([N3(":a :b (:e0 :e1) .")]) -# stats = fakeStats() -# cands = list(l.findCandidateBindings(ws, stats)) -# self.assertLess(stats['permCountFailingVerify'], 20) \ No newline at end of file
--- a/service/mqtt_to_rdf/lhs_evaluation_test.py Mon Sep 20 23:19:40 2021 -0700 +++ b/service/mqtt_to_rdf/lhs_evaluation_test.py Mon Sep 20 23:20:46 2021 -0700 @@ -3,8 +3,6 @@ from rdflib import RDF, ConjunctiveGraph, Literal, Namespace from rdflib.parser import StringInputSource -from lhs_evaluation import _parseList - EX = Namespace('http://example.com/') @@ -16,23 +14,3 @@ g.parse(StringInputSource((prefix + txt).encode('utf8')), format='n3') return g - -class TestParseList(unittest.TestCase): - - def test0Elements(self): - g = N3(":a :b () .") - bn = g.value(EX['a'], EX['b']) - elems, used = _parseList(g, bn) - self.assertEqual(elems, []) - self.assertFalse(used) - - def test1Element(self): - g = N3(":a :b (0) .") - bn = g.value(EX['a'], EX['b']) - elems, used = _parseList(g, bn) - self.assertEqual(elems, [Literal(0)]) - used = sorted(used) - self.assertEqual(used, [ - (bn, RDF.first, Literal(0)), - (bn, RDF.rest, RDF.nil), - ])