def test_when_passed_start_event_grains():
    mock_opts = salt.config.DEFAULT_MINION_OPTS.copy()
    # provide mock opts an os grain since we'll look for it later.
    mock_opts["grains"]["os"] = "linux"
    mock_opts["start_event_grains"] = ["os"]
    io_loop = salt.ext.tornado.ioloop.IOLoop()
    io_loop.make_current()
    minion = salt.minion.Minion(mock_opts, io_loop=io_loop)
    try:
        minion.tok = MagicMock()
        minion._send_req_sync = MagicMock()
        minion._fire_master(
            "Minion has started", "minion_start", include_startup_grains=True
        )
        load = minion._send_req_sync.call_args[0][0]

        assert "grains" in load
        assert "os" in load["grains"]
    finally:
        minion.destroy()