import ee.digikey as dk import os.path import yaml import sys basedir = os.path.dirname(os.path.abspath(__file__)) digikey = dk.Digikey() client = dk.DigikeyClient(digikey) def test_digikey_1(): p = client.search("TCR2LF18LM(CTTR-ND") assert isinstance(p, dk.DigikeyProduct) assert p.part_number == "TCR2LF18LM(CTTR-ND" assert len(p.attributes) > 5 x = p.to_yaml() print(type(x)) print("{}".format(x)) yaml.dump(x, sys.stdout) def test_digikey_2(): response = client.search("TCR2LF") [print(p.part_id) for p in response.products] assert len(response.products) == 28 # p = products[0] # assert p.part_number == "TCR2LF18LM(CTTR-ND"