Skip to content

Commit

Permalink
Expand directed gnp test
Browse files Browse the repository at this point in the history
  • Loading branch information
enavarro51 committed Aug 1, 2023
1 parent 50e1e68 commit 361b128
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/rustworkx_tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

import unittest
import random
from ddt import ddt, data

import rustworkx


@ddt
class TestGNPRandomGraph(unittest.TestCase):
def test_random_gnp_directed(self):
graph = rustworkx.directed_gnp_random_graph(20, 0.5, seed=10)
self.assertEqual(len(graph), 20)
self.assertEqual(len(graph.edges()), 189)
@data((15, 20, 0.7, 156), (20, 10, 0.5, 189), (22, 6, 0.2, 91))
def test_random_gnp_directed(self, args):
graph = rustworkx.directed_gnp_random_graph(args[0], args[2], seed=args[1])
self.assertEqual(len(graph), args[0])
self.assertEqual(len(graph.edges()), args[3])

def test_random_gnp_directed_empty_graph(self):
graph = rustworkx.directed_gnp_random_graph(20, 0)
Expand Down

0 comments on commit 361b128

Please sign in to comment.