Skip to content

Commit

Permalink
fixing formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Dec 4, 2024
1 parent d0a0602 commit 5d2cd4e
Showing 1 changed file with 101 additions and 39 deletions.
140 changes: 101 additions & 39 deletions tests/test_chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,50 +137,112 @@ def test_get_leaves_many(self, myclient):
svids_ret = myclient.chunkedgraph.get_leaves_many(root_ids)
for k, v in svids_ret.items():
assert np.all(v == sv_dict[str(k)])

@responses.activate
def test_minimal_covering_nodes(self, myclient):
endpoint_mapping = self._default_endpoint_map
l2ids = [151733086944494680, 151803455688671629, 151803524408148361,
151803524408148371, 151873824432849265, 151873893152326692,
151873961871802557, 151944261829395442, 151944261896503344,
151944330615980096, 152014630573572920, 152014630573573159,
152014699360157777, 152084999317750839, 152155368061928130,
152225736806105726, 152296105550283453, 152296174269760177,
152366543013938289, 152436911758115473, 152436980477592301,
152507349221769815, 152577717965948027, 152577786685424795,
152577786685424797, 152648155429602343, 152648155429602345,
152648224149078995, 152718524173779595, 152718592893256250,
152788961637433848, 152859330381611287, 152859399101088529,
152929767845266045, 152929767845266047, 152929836564742225,
153000136589443132, 153000205308919861, 153070574053098110,
153140942797275294, 153141011516751998, 153141080236228767,
153211311541453183, 153211380260929846, 153211448980406620,
153211448980406624, 153211517699883483, 153281817724584437,
153281886444061198, 153352186468762089, 153352255188238828,
153422623932416499, 153422692651893340, 153492992676594177,
153493061396070924, 153563430140248766, 153563498859725522,
153633798884426257, 153633867603903006, 153704236348080465,
153774605092258013, 153774673811734916, 153844973836435679,
153845042555912428, 153915342580613364, 153915411300090031,
153985711324791351, 154056080068969264, 154126448813146756,
154126448813146804, 154126517532623397, 154196817557324412,
154196886276800996, 154267186301502007, 154267255020978536,
154337623765156171, 154337692484633043]

covering_nodes = [226343819258366071, 298438259283864547,
441652105523081273, 441652105523071767,
441652105523184668, 441634513337085631,
650770146159222932]

url = chunkedgraph_endpoints_v1["minimal_covering_nodes"].format_map(endpoint_mapping)
l2ids = [
151733086944494680,
151803455688671629,
151803524408148361,
151803524408148371,
151873824432849265,
151873893152326692,
151873961871802557,
151944261829395442,
151944261896503344,
151944330615980096,
152014630573572920,
152014630573573159,
152014699360157777,
152084999317750839,
152155368061928130,
152225736806105726,
152296105550283453,
152296174269760177,
152366543013938289,
152436911758115473,
152436980477592301,
152507349221769815,
152577717965948027,
152577786685424795,
152577786685424797,
152648155429602343,
152648155429602345,
152648224149078995,
152718524173779595,
152718592893256250,
152788961637433848,
152859330381611287,
152859399101088529,
152929767845266045,
152929767845266047,
152929836564742225,
153000136589443132,
153000205308919861,
153070574053098110,
153140942797275294,
153141011516751998,
153141080236228767,
153211311541453183,
153211380260929846,
153211448980406620,
153211448980406624,
153211517699883483,
153281817724584437,
153281886444061198,
153352186468762089,
153352255188238828,
153422623932416499,
153422692651893340,
153492992676594177,
153493061396070924,
153563430140248766,
153563498859725522,
153633798884426257,
153633867603903006,
153704236348080465,
153774605092258013,
153774673811734916,
153844973836435679,
153845042555912428,
153915342580613364,
153915411300090031,
153985711324791351,
154056080068969264,
154126448813146756,
154126448813146804,
154126517532623397,
154196817557324412,
154196886276800996,
154267186301502007,
154267255020978536,
154337623765156171,
154337692484633043,
]

covering_nodes = [
226343819258366071,
298438259283864547,
441652105523081273,
441652105523071767,
441652105523184668,
441634513337085631,
650770146159222932,
]

url = chunkedgraph_endpoints_v1["minimal_covering_nodes"].format_map(
endpoint_mapping
)
query_d = {"as_array": True}
urlq = url + "?" + urlencode(query_d)
responses.add(responses.POST,
body=np.array(covering_nodes).tobytes(),
url=urlq,
match=[json_params_matcher({"node_ids": l2ids})])

responses.add(
responses.POST,
body=np.array(covering_nodes).tobytes(),
url=urlq,
match=[json_params_matcher({"node_ids": l2ids})],
)

node_ids = myclient.chunkedgraph.get_minimal_covering_nodes(l2ids)
assert np.all(node_ids == np.array(covering_nodes))

Expand Down

0 comments on commit 5d2cd4e

Please sign in to comment.