def test_force_edges_active_move_calls_force_edge_active_move(): q00 = GridQubit(0, 0) q01 = GridQubit(0, 1) q10 = GridQubit(1, 0) q11 = GridQubit(1, 1) search = AnnealSequenceSearch(_create_device([q00, q01, q10, q11]), seed=0xF00D0005) with mock.patch.object(search, '_force_edge_active_move') as force_edge_active_move: search._force_edges_active_move(search._create_initial_solution()) force_edge_active_move.assert_called_with(mock.ANY)
def test_force_edges_active_move_does_not_change_input(): q00 = GridQubit(0, 0) q01 = GridQubit(0, 1) q10 = GridQubit(1, 0) q11 = GridQubit(1, 1) search = AnnealSequenceSearch(_create_device([q00, q01, q10, q11]), seed=0xF00D0004) seqs, edges = search._create_initial_solution() seqs_copy, edges_copy = list(seqs), edges.copy() search._force_edges_active_move((seqs, edges)) assert seqs == seqs_copy assert edges == edges_copy