code: def test_bfs_tree(self):
      T = nx.bfs_tree(self.G, source=0)
      assert sorted(T.nodes()) == sorted(self.G.nodes())
      assert sorted(T.edges()) == [(0, 1), (1, 2), (1, 3), (2, 4)]
  
imports: from functools import partial
  import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestBFS obj's underlying member method code with example usage: obj.test_bfs_tree() without return types