Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Removed 4 TODOs, details below
Browse files Browse the repository at this point in the history
__init__.py ~124: Made issue #23 covering the TODO
__init__.py ~145: Fixed small error in intersphinx link in `collector.py`
bot.py ~72: Made issue #22 covering the TODO
bot.py ~102: Made issue #24, should be ez to fix
  • Loading branch information
Cobular committed Jun 22, 2019
1 parent ccd3b63 commit 626ef77
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions distest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def run_interactive_bot(target_name, token, test_collector, timeout=5):
:param TestCollector test_collector: The collector that gathered our tests.
:param int timeout: The amount of time to wait for responses before failing tests.
"""
# TODO: Implement interactive timeout

bot = DiscordInteractiveInterface(target_name, test_collector)
bot.run(token) # Starts the bot
Expand All @@ -142,7 +141,6 @@ def run_command_line_bot(target, token, tests, channel_id, stats, collector, tim
:param TestCollector collector: The collector that gathered our tests.
:param int timeout: The amount of time to wait for responses before failing tests.
"""
# TODO: Fix the reference, not sure how to do that rn. Don't have internet
bot = DiscordCliInterface(target, collector, tests, channel_id, stats, timeout)
failed = bot.run(token) # returns True if a test failed
sys.exit(1 if failed else 0) # Calls sys.exit based on the state of `failed`
3 changes: 1 addition & 2 deletions distest/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def run_test(
await test.func(test_interface)
except TestRequirementFailure:
test.result = TestResult.FAILED
if not stop_error: # TODO: make stopping on errors optional by using this
if not stop_error:
raise
else:
test.result = TestResult.SUCCESS
Expand Down Expand Up @@ -99,7 +99,6 @@ async def _run_by_predicate(self, channel, predicate=lambda test: True):
:param discord.TextChannel channel: The channel to run the test in.
:param function predicate: The check a test must pass to be run.
"""
# TODO: explain what predicate means a bit more
for test in self._tests:
if predicate(test):
await self.run_test(test, channel, stop_error=True)
Expand Down
2 changes: 1 addition & 1 deletion distest/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def add(self, function, name: str = "", needs_human: bool = False):
:param func function: The function to add
:param str name: The name of the function to add, defaults to the function name but can be overridden
with the provided name just like with :discord:func:`discord.ext.bot.command()`.
with the provided name just like with :py:class:`discord.ext.commands.Command`.
See sample code above.
:param bool needs_human: Optional boolean, true if the test requires a human interaction
"""
Expand Down

0 comments on commit 626ef77

Please sign in to comment.