async def howmany(context: commands.Context) -> None: """ Prints how many entries are currently submitted for the upcoming week. """ response = "%d, so far." % compo.count_valid_entries(True) await context.channel.send(response)
def test_only_invalid_entries_is_zero_valid(self): week = compo.blank_week() entry = compo.create_blank_entry("Invalid", 0) week["entries"].append(entry) assert not compo.entry_valid(entry) assert compo.count_valid_entries(week) == 0
def test_counts_valid_entries(self): week = compo.blank_week() entry = compo.create_blank_entry("Invalid", 0) entry["pdf"] = "yes" entry["pdfFilename"] = "here" entry["mp3"] = "yes" entry["mp3Format"] = "here" entry["mp3Filename"] = "yes" week["entries"].append(entry) assert compo.entry_valid(entry) assert compo.count_valid_entries(week) == 1
def test_no_entries_is_zero_valid(self): week = compo.blank_week() assert compo.count_valid_entries(week) == 0