Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_chip_converter():
chips = ["TC", "WC", "BB", "FH"]
converted = [chip_converter(chip) for chip in [
"3xc", "wildcard", "bboost", "freehit"]]
assert chips == converted
def available_chips(chips):
"""Returns formatted string of available chips."""
available = ["WC", "TC", "BB", "FH"]
used = [chip_converter(chip["name"]) for chip in chips]
return ", ".join(list(set(available) - set(used)))
def used_chips(chips):
"""Returns formatted string of used chips."""
if not chips:
return "NONE."
used = ["{} (GW {})".format(chip_converter(chip["name"]), chip["event"])
for chip in chips]
return ", ".join(used)