def METHOD_NAME(hw):
    motor = hw.motor
    det = hw.motor
    ip = FakeIPython({'motor': motor, 'det': det})
    sm = BlueskyMagics(ip)
    # Test an empty list with no labels set.
    sm.wa('')
    # Test again with labeled objects.
    motor._ophyd_labels_ = ['motors']
    motor._ophyd_labels_ = ['detectors']
    # Test an empty list.
    sm.wa('')
    # Test with a label whitelist
    sm.wa('motors')
    sm.wa('motors detectors')
    sm.wa('motors typo')
    with pytest.raises(ValueError):
        sm.wa('[motors, detectors]')