diff --git a/src/DescriptorsCommand.cc b/src/DescriptorsCommand.cc index 23fc3a2d..b8dd5027 100644 --- a/src/DescriptorsCommand.cc +++ b/src/DescriptorsCommand.cc @@ -960,11 +960,13 @@ int FindDescriptor::construct_protobuf(PMGDQuery &query, Json::Value node_constraints = constraints; cp_result["ids_array"] = ids_array; - //TODO QUERY REFACTOR MODS-Still queries for link_to_set - for (int i = 0; i < ids.size(); ++i){ + for (int i = 0; i < ids.size(); ++i){ printf("IDS!\n"); Json::Value k_node_constraints; + //Theoretically this makes a deep copy + k_node_constraints = constraints; + // Create a vector with a string and an integer std::vector values; values.push_back("=="); diff --git a/tests/python/TestDescriptors.py b/tests/python/TestDescriptors.py index 658b6677..1c7bef93 100644 --- a/tests/python/TestDescriptors.py +++ b/tests/python/TestDescriptors.py @@ -648,10 +648,9 @@ def test_findDescByBlobUnusedRef(self): response, blob_array = db.query(all_queries, [descriptor_blob]) # Check success - self.assertEqual(response[0]["FindDescriptor"]["status"], 0) - self.assertEqual(response[0]["FindDescriptor"]["returned"], kn) - self.assertEqual(len(blob_array), kn) - self.assertEqual(descriptor_blob[0], blob_array[0]) + self.assertEqual(response[0]["status"], -1) + self.assertEqual(response[0]["info"], "_ref is not supported for KNN search") + self.disconnect(db) # @unittest.skip("Skipping class until fixed") @@ -785,23 +784,25 @@ def test_findDescByBlobWithLink(self): all_queries.append(query) response, blob_array = db.query(all_queries, [descriptor_blob]) + self.assertEqual(response[0]["status"], -1) + self.assertEqual(response[0]["info"], "_ref is not supported for KNN search") - self.assertEqual(len(blob_array), kn) + #self.assertEqual(len(blob_array), kn) # This checks that the received blobs is the same as the inserted. - self.assertEqual(descriptor_blob[0], blob_array[0]) + #self.assertEqual(descriptor_blob[0], blob_array[0]) # Check success - self.assertEqual(response[0]["FindDescriptor"]["status"], 0) - self.assertEqual(response[0]["FindDescriptor"]["returned"], kn) + #self.assertEqual(response[0]["FindDescriptor"]["status"], 0) + #self.assertEqual(response[0]["FindDescriptor"]["returned"], kn) - self.assertEqual(response[0]["FindDescriptor"]["entities"][0]["_distance"], 0) - self.assertEqual(response[0]["FindDescriptor"]["entities"][1]["_distance"], 400) - self.assertEqual(response[0]["FindDescriptor"]["entities"][2]["_distance"], 400) + #self.assertEqual(response[0]["FindDescriptor"]["entities"][0]["_distance"], 0) + #self.assertEqual(response[0]["FindDescriptor"]["entities"][1]["_distance"], 400) + #self.assertEqual(response[0]["FindDescriptor"]["entities"][2]["_distance"], 400) - self.assertEqual(response[1]["FindEntity"]["status"], 0) - self.assertEqual(response[1]["FindEntity"]["returned"], kn) + #self.assertEqual(response[1]["FindEntity"]["status"], 0) + #self.assertEqual(response[1]["FindEntity"]["returned"], kn) - self.assertEqual(response[1]["FindEntity"]["entities"][0]["entity_prop"], 200) - self.assertEqual(response[1]["FindEntity"]["entities"][1]["entity_prop"], 201) - self.assertEqual(response[1]["FindEntity"]["entities"][2]["entity_prop"], 202) + #self.assertEqual(response[1]["FindEntity"]["entities"][0]["entity_prop"], 200) + #self.assertEqual(response[1]["FindEntity"]["entities"][1]["entity_prop"], 201) + #self.assertEqual(response[1]["FindEntity"]["entities"][2]["entity_prop"], 202) self.disconnect(db)