class_docstr: Tests of GraphSAGELinkGenerator class
code: def test_batch_feature_shapes(self):
      G = example_graph(feature_size=self.n_feat, is_directed=True)
      data_size = G.number_of_edges()
      edge_labels = [0] * data_size
  
      mapper = DirectedGraphSAGELinkGenerator(
          G,
          batch_size=self.batch_size,
          in_samples=self.in_samples,
          out_samples=self.out_samples,
      ).flow(G.edges(), edge_labels)
  
      assert len(mapper) == 2
  
      for batch in range(len(mapper)):
          nf, nl = mapper[batch]
  
          assert len(nf) == 2 ** (len(self.in_samples) + 2) - 2
  
          ins, outs = self.in_samples, self.out_samples
          dims = [
              1,
              ins[0],
              outs[0],
              ins[0] * ins[1],
              ins[0] * outs[1],
              outs[0] * ins[1],
              outs[0] * outs[1],
          ]
  
          for ii, dim in zip(range(7), dims):
              assert (
                  nf[2 * ii].shape
                  == nf[2 * ii + 1].shape
                  == (min(self.batch_size, data_size), dim, self.n_feat)
              )
  
      with pytest.raises(IndexError):
          nf, nl = mapper[2]
  
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 2 for calling the Test_DirectedGraphSAGELinkGenerator obj's underlying member method code with example usage: obj.test_batch_feature_shapes() without return types