def test_recursion_block(self):
     """Test blocked on layer 1 gives placement on layer 2"""
     out = _recursive_find_layer(layer_to_check=3,
                                 op_occupied_wires={0},
                                 occupied_wires_per_layer=[{1}, {0}, {1},
                                                           {1}])
     assert out == 2
 def test_blocked_layer(self):
     """Test operation moved to higher layer if blocked on 0th layer."""
     out = _recursive_find_layer(layer_to_check=0,
                                 op_occupied_wires={0},
                                 occupied_wires_per_layer=[{0}])
     assert out == 1
 def test_recursion_no_block(self):
     """Test recursion to zero if start in higher layer and not blocked"""
     out = _recursive_find_layer(layer_to_check=2,
                                 op_occupied_wires={0},
                                 occupied_wires_per_layer=[{1}, {1}, {1}])
     assert out == 0
 def test_first_layer(self):
     """Test operation remains in 0th layer if not blocked"""
     out = _recursive_find_layer(layer_to_check=0,
                                 op_occupied_wires={0},
                                 occupied_wires_per_layer=[{1}])
     assert out == 0