summaryrefslogtreecommitdiff
path: root/tests/test_connected_components.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_connected_components.py')
-rw-r--r--tests/test_connected_components.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_connected_components.py b/tests/test_connected_components.py
new file mode 100644
index 0000000..10d7a23
--- /dev/null
+++ b/tests/test_connected_components.py
@@ -0,0 +1,12 @@
+import unittest
+from sources.connected_components import number_of_components
+
+class MyTestCase(unittest.TestCase):
+ def test_something(self):
+ adj = [[1], [0, 2], [1], []]
+
+ self.assertEqual(2, number_of_components(adj))
+
+
+if __name__ == '__main__':
+ unittest.main()