code: def test_build(self):
      data = Reader().read("./tests/graph_data.txt", sep=" ")
      gmd = GraphModality(data=data)
  
      global_iid_map = OrderedDict()
      for raw_iid, raw_jid, val in data:
          global_iid_map.setdefault(raw_iid, len(global_iid_map))
  
      gmd.build(id_map=global_iid_map)
  
      self.assertEqual(len(gmd.map_rid), 7)
      self.assertEqual(len(gmd.map_cid), 7)
      self.assertEqual(len(gmd.val), 7)
      self.assertEqual(gmd.matrix.shape, (7, 7))
  
      try:
          GraphModality().build()
      except ValueError:
          assert True
  
file_path: cornac/tests/cornac/data/test_graph.py
imports: import unittest
  import numpy
  from cornac.data import GraphModality
  from cornac.data import Reader
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling the TestGraphModality obj's underlying member method code with example usage: obj.test_build() without return types