예제 #1
0
 def test_C_EnsureKeys(self):
     d1 = {'b': 1, 'e': 2, 'f': 3}
     d1copy = copy.deepcopy(d1)
     phlsys_dictutil.ensure_keys(d1, ['a', 'b', 'c', 'd', 'e'])
     self.assertDictContainsSubset(d1copy, d1)
     d2 = {'a': None, 'b': 1, 'c': None, 'd': None, 'e': 2, 'f': 3}
     self.assertDictEqual(d1, d2)
 def test_C_EnsureKeys(self):
     d1 = {'b': 1, 'e': 2, 'f': 3}
     d1copy = copy.deepcopy(d1)
     phlsys_dictutil.ensure_keys(d1, ['a', 'b', 'c', 'd', 'e'])
     self.assertDictContainsSubset(d1copy, d1)
     d2 = {'a': None, 'b': 1, 'c': None, 'd': None, 'e': 2, 'f': 3}
     self.assertDictEqual(d1, d2)
def query(
        conduit,
        ids=None):  # list(uint)
    # TODO: typechecking
    d = phlsys_dictutil.copy_dict_no_nones({'ids': ids})
    response = conduit.call("differential.query", d)
    query_response_list = []
    for r in response:
        phlsys_dictutil.ensure_keys(r, ["sourcePath", "auxiliary"])
        r["id"] = int(r["id"])
        r["status"] = int(r["status"])
        query_response_list.append(QueryResponse(**r))
    return query_response_list
def query(
        conduit,
        ids=None):  # list(uint)
    # TODO: typechecking
    d = phlsys_dictutil.copy_dict_no_nones({'ids': ids})
    response = conduit("differential.query", d)
    query_response_list = []
    for r in response:
        phlsys_dictutil.ensure_keys(r, ["sourcePath", "auxiliary"])
        r["id"] = int(r["id"])
        r["status"] = int(r["status"])
        query_response_list.append(QueryResponse(**r))
    return query_response_list