Example #1
0
 def things(self, query):
     return self.query_results.get(dicthash(query), [])
Example #2
0
 def add_query(self, query, result):
     self.query_results[dicthash(query)] = result
Example #3
0
def test_dicthash():
    assert dicthash({}) == dicthash({})
    assert dicthash({"a": 1}) == dicthash({"a": 1})
    assert dicthash({"a": 1, "b": 2}) == dicthash({"b": 2, "a": 1})
    assert dicthash({}) != dicthash({"a": 1})
    assert dicthash({"b": 1}) != dicthash({"a": 1})