From ffe134af95599c25cf05bb0c9da01ca598db368b Mon Sep 17 00:00:00 2001
From: angloth <angus.lothian@hotmail.com>
Date: Thu, 27 Feb 2020 18:09:40 +0100
Subject: [PATCH] Add some graphID test cases

---
 test/graph_id/conftest.py      |  2 ++
 test/graph_id/test_graph_id.py | 38 ++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 test/graph_id/conftest.py
 create mode 100644 test/graph_id/test_graph_id.py

diff --git a/test/graph_id/conftest.py b/test/graph_id/conftest.py
new file mode 100644
index 00000000..ba28d09a
--- /dev/null
+++ b/test/graph_id/conftest.py
@@ -0,0 +1,2 @@
+import pytest
+from test.fixtures.graph_id import *
diff --git a/test/graph_id/test_graph_id.py b/test/graph_id/test_graph_id.py
new file mode 100644
index 00000000..9d1d8e5c
--- /dev/null
+++ b/test/graph_id/test_graph_id.py
@@ -0,0 +1,38 @@
+"""
+B-ASIC test suite for GraphID.
+"""
+
+from b_asic.graph_id import GraphID
+
+import pytest
+
+def test_create_graph_id():
+    graph_id = GraphID("add", 1)
+
+    assert graph_id.graph_id_type == "add"
+    assert graph_id.graph_id_number == 1
+
+    graph_id2 = GraphID("", 2)
+
+    assert graph_id2.graph_id_type == ""
+    assert graph_id2.graph_id_number == 2
+
+    graph_id3 = GraphID("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 3)
+
+    assert graph_id3.graph_id_type == "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+    assert graph_id3.graph_id_number == 3
+
+def test_graph_id_str(graph_ids):
+    assert str(graph_ids[0]) == "add1"
+    assert str(graph_ids[1]) == "add2"
+    assert str(graph_ids[2]) == "sig1"
+    assert str(graph_ids[3]) == "sig1"
+    assert str(graph_ids[4]) == "sub3"
+    assert str(graph_ids[5]) == "ÅÄÖ2"
+    assert str(graph_ids[6]) == "3"
+    assert str(graph_ids[7]) == "ABCDEFGHIJKLMNOPQRSTUVWXYZ4"
+
+
+
+
+
-- 
GitLab