def METHOD_NAME(write_error, restart_error, result):
    frr = MagicMock()
    frr.write = MagicMock(return_value = write_error)
    frr.restart_peer_groups = MagicMock(return_value = restart_error)
    c = ConfigMgr(frr)
    c.reset = MagicMock()
    c.push_list(["change1", "change2"])
    c.restart_peer_groups(["pg1", "pg2"])
    res = c.commit()
    assert res == result
    assert c.reset.called
    frr.write.assert_called_with('change1\nchange2\n')
    frr.restart_peer_groups.assert_called_with(["pg1", "pg2"])