class_docstr: Tests of HinSAGELinkGenerator class
code: def test_HinSAGELinkGenerator_constructor(self):
      # Constructor with a homogeneous graph:
      G = example_HIN_homo(self.n_feat)
      links = [(1, 4), (1, 5), (0, 4), (5, 0)]  # ('user', 'user') links
      link_labels = [0] * len(links)
  
      gen = HinSAGELinkGenerator(
          G,
          batch_size=self.batch_size,
          num_samples=self.num_samples,
          head_node_types=["B", "B"],
      )
      mapper = gen.flow(links, link_labels)
  
      assert mapper.data_size == len(links)
      assert len(mapper.ids) == len(links)
      assert tuple(gen.head_node_types) == ("B", "B")
  
      # Constructor with a heterogeneous graph:
      G = example_hin_1(self.n_feat)
      links = [
          (1, 4),
          (1, 5),
          (0, 4),
          (0, 5),
      ]  # ('movie', 'user') links
      link_labels = [0] * len(links)
  
      gen = HinSAGELinkGenerator(
          G,
          batch_size=self.batch_size,
          num_samples=self.num_samples,
          head_node_types=["A", "B"],
      )
      mapper = gen.flow(links, link_labels)
  
      assert mapper.data_size == len(links)
      assert len(mapper.ids) == len(links)
      assert mapper.data_size == len(link_labels)
      assert tuple(gen.head_node_types) == ("A", "B")
  
imports: import numpy
  import networkx
  import pytest
  import random
  from stellargraph.mapper import *
  from stellargraph.core.graph import *
  from stellargraph.data.unsupervised_sampler import *
  from ..test_utils.graphs import example_graph, example_graph_random, example_hin_1, repeated_features, weighted_tree
  from ..None import test_utils
label_desc: Use image node_id 1 for calling the Test_HinSAGELinkGenerator obj's underlying member method code with example usage: obj.test_HinSAGELinkGenerator_constructor() without return types