diff --git a/test/graph_id/conftest.py b/test/graph_id/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..ba28d09a3832215abc6efa3c03d8a75340158e2d --- /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 0000000000000000000000000000000000000000..9d1d8e5c1f9c0993458d099545b0b7ce65283520 --- /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" + + + + +