Page MenuHomeSoftware Heritage

graph: add test for the "algo" parameter of walk()
Open, NormalPublic

Description

If I change the code like this:

diff --git a/swh/graph/backend.py b/swh/graph/backend.py
index 750849a..7facd5c 100644
--- a/swh/graph/backend.py
+++ b/swh/graph/backend.py
@@ -75,6 +75,7 @@ def count(self, ttype, direction, edges_fmt, src):
             yield node_id
 
     async def walk(self, direction, edges_fmt, algo, src, dst):
+        algo = "bfs"
         if dst in EXTENDED_SWHID_TYPES:
             it = self.stream_proxy.walk_type(direction, edges_fmt, algo, src, dst)
         else:

Then it breaks no test. Likewise with "dfs" instead of "bfs".

Event Timeline

vlorentz triaged this task as Normal priority.Mon, May 3, 5:16 PM
vlorentz created this task.
zack renamed this task from swh-graph: No tests of the "algo" parameter of walk() to graph: add test for the "algo" parameter of walk().Mon, May 3, 6:55 PM
zack added a project: Easy hack.