summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlimi Qudirah <qudrohbidemi@gmail.com>2023-05-03 10:55:29 +0100
committerGitHub <noreply@github.com>2023-05-03 12:55:29 +0300
commit5dc9640142cac3642e0bed121bb6a8bfee4ef96e (patch)
tree2b855721b6f6e96e363cda1e7a541cc83afe5e0a
parentc37b27664f1002b041f1e9fb7e88209e6d8f8f1d (diff)
downloadnetworkx-5dc9640142cac3642e0bed121bb6a8bfee4ef96e.tar.gz
added tests to euler.py (#6608)
* fixes-for-6607 * Update networkx/algorithms/tests/test_euler.py Co-authored-by: Mridul Seth <mail@mriduls.com> * Update euler test --------- Co-authored-by: Mridul Seth <mail@mriduls.com> Co-authored-by: Mridul Seth <git@mriduls.com>
-rw-r--r--networkx/algorithms/tests/test_euler.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/networkx/algorithms/tests/test_euler.py b/networkx/algorithms/tests/test_euler.py
index cba66ee6..08eaf7fc 100644
--- a/networkx/algorithms/tests/test_euler.py
+++ b/networkx/algorithms/tests/test_euler.py
@@ -239,6 +239,18 @@ class TestEulerianPath:
with pytest.raises(nx.NetworkXError):
list(nx.eulerian_path(G, source=1))
+ @pytest.mark.parametrize(
+ ("graph_type", "result"),
+ (
+ (nx.MultiGraph, [(0, 1, 0), (1, 0, 1)]),
+ (nx.MultiDiGraph, [(0, 1, 0), (1, 0, 0)]),
+ ),
+ )
+ def test_eulerian_with_keys(self, graph_type, result):
+ G = graph_type([(0, 1), (1, 0)])
+ answer = nx.eulerian_path(G, keys=True)
+ assert list(answer) == result
+
class TestEulerize:
def test_disconnected(self):