from . import boardtype

import subprocess
import pytest


@pytest.mark.skipif(not boardtype.is_devkit(), reason="Not a devkit")
def test_usb_hub():
    out = subprocess.check_output(["lsusb", "-d", "14cd:8601"])
    assert(b"Super Top" in out)


@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_phone_usb_hub():
    out = subprocess.check_output(["lsusb", "-d", "0424:2640"])
    assert(b"Standard Microsystems" in out)


@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_usb_media_card():
    out = subprocess.check_output(["lsusb", "-d", "0424:4041"])
    assert(b"media card controller" in out)
