Newer
Older
"""
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"
def test_graph_id_repr(graph_ids):
assert repr(graph_ids[0]) == "add1"
assert repr(graph_ids[1]) == "add2"
assert repr(graph_ids[2]) == "sig1"
assert repr(graph_ids[3]) == "sig1"
assert repr(graph_ids[4]) == "sub3"
assert repr(graph_ids[5]) == "ÅÄÖ2"
assert repr(graph_ids[6]) == "3"
assert repr(graph_ids[7]) == "ABCDEFGHIJKLMNOPQRSTUVWXYZ4"
def test_graph_id_eq(graph_ids):
assert graph_ids[0] == graph_ids[0]
assert graph_ids[0] != graph_ids[1]
assert graph_ids[2] == graph_ids[3]
assert graph_ids[0] != graph_ids[2]
assert graph_ids[4] != graph_ids[6]