user124707: I am trying to write a test with the bitcoin/test/functional/example_test.py to get node 1 to mine another block, send it to node 2, and check that node 2 received it. Any idea on how to go about/get started on this? I am familiar with python but this is fairly new to me.
Thanks.

user48884: The default setup_network() implemented by the test framework connects all nodes, as explained by the comment in example_test.py's setup_network(). Since you want node 2 to be connected to nodes 1 and 0, you can simply delete the setup_network() implemented in example_test.py to use the default setup_network(). Then inside of run_test(), you can just do .generate() with any of the nodes and the block should be synced to all of the other nodes.
To guarantee that all nodes are synced to the same block, you can use self.sync_blocks() which will ensure that every node has the same tip before it returns.
Your run test would have something like:
def run_test(self):
    self.nodes[0].generate(1)
    self.sync_blocks()


124707: <p>I am trying to write a test with the bitcoin/test/functional/example_test.py to get node 1 to mine another block, send it to node 2, and check that node 2 received it. Any idea on how to go about/get started on this? I am familiar with python but this is fairly new to me.</p>
<p>Thanks.</p>
 48884: <p>The default <code>setup_network()</code> implemented by the test framework connects all nodes, as explained by the comment in <code>example_test.py</code>'s <code>setup_network()</code>. Since you want node 2 to be connected to nodes 1 and 0, you can simply delete the <code>setup_network()</code> implemented in <code>example_test.py</code> to use the default <code>setup_network()</code>. Then inside of <code>run_test()</code>, you can just do <code>.generate()</code> with any of the nodes and the block should be synced to all of the other nodes.</p>
<p>To guarantee that all nodes are synced to the same block, you can use <code>self.sync_blocks()</code> which will ensure that every node has the same tip before it returns.</p>
<p>Your run test would have something like:</p>
<pre><code>def run_test(self):
    self.nodes[0].generate(1)
    self.sync_blocks()
</code></pre>
