Example #1
0
    async def status_shouted(self, ctx):
        """same as `$status`, but mentioning @everyone
"""
        dipgame = scraper.get_dipgame_checked(self.game_id)
        status_message = bot_utilities.create_urgent_message(
            app.announce_overall_game_state(dipgame), ctx.message.author.name)
        await ctx.message.channel.send(status_message)
Example #2
0
    async def status(self, ctx):
        """instructs me to report on the status of my webdip game.

        """
        dipgame = scraper.get_dipgame_checked(self.game_id)
        status_message = app.announce_overall_game_state(dipgame)
        await ctx.message.channel.send(status_message)
Example #3
0
    async def status_verbose(self, ctx):
        """same as `$status`, but with additional information about the game
state. useful for beginners.

        """
        dipgame = scraper.get_dipgame_checked(self.game_id)
        status_message = app.announce_overall_game_state(dipgame, verbose=True)
        await ctx.message.channel.send(status_message)
Example #4
0
def report(verbose):
    dipgame = scraper.get_dipgame_checked(app.get_game_id())
    try:
        assert dipgame != False
    except:
        click.echo("exiting...")
        exit(1)

    click.echo(app.announce_overall_game_state(dipgame, verbose))
Example #5
0
def test_can_accurately_report_overall_game_state():
    """ loosely test the report of overall game state
"""
    announcement = app.announce_overall_game_state(
        testdata.pop_the_bee_DipGame)
    assert type(announcement) == str
    assert "1904" in announcement
    assert "Spring" in announcement
    assert "diplomacy" in announcement
    assert "3.0" in announcement
    assert "04/04/20" in announcement
    assert "22:51:45" in announcement

    announcement_retreats = app.announce_overall_game_state(
        testdata.pop_the_bee_retreats_DipGame)
    assert type(announcement) == str
    assert "1905" in announcement_retreats
    assert "Autumn" in announcement_retreats
    assert "retreats" in announcement_retreats
    assert "161.6" in announcement_retreats
    assert "09/13/2020" in announcement_retreats
    assert "12:26:39" in announcement_retreats

    announcement_builds = app.announce_overall_game_state(
        testdata.pop_the_bee_builds_DipGame)
    assert type(announcement) == str
    assert "1905" in announcement_builds
    assert "Autumn" in announcement_builds
    assert "builds" in announcement_builds
    assert "0.1" in announcement_builds
    assert "09/13/2020" in announcement_builds
    assert "15:13:20" in announcement_builds

    announcement_finished = app.announce_overall_game_state(
        testdata.pop_the_bee_finished_DipGame)
    assert type(announcement) == str
    assert "1910" in announcement_finished
    assert "Autumn" in announcement_finished
    assert "finished" in announcement_finished
    assert "None" not in announcement_finished
Example #6
0
def test_verbose_descriptions_are_longer():
    announcement = app.announce_overall_game_state(
        testdata.pop_the_bee_DipGame)
    verbose_announcement = app.announce_overall_game_state(
        testdata.pop_the_bee_DipGame, True)
    assert len(verbose_announcement.split()) > len(announcement.split())

    announcement_retreats = app.announce_overall_game_state(
        testdata.pop_the_bee_retreats_DipGame)
    verbose_announcement_retreats = app.announce_overall_game_state(
        testdata.pop_the_bee_retreats_DipGame, True)

    assert len(verbose_announcement.split()) > len(
        announcement_retreats.split())

    announcement_builds = app.announce_overall_game_state(
        testdata.pop_the_bee_builds_DipGame)
    verbose_announcement_builds = app.announce_overall_game_state(
        testdata.pop_the_bee_builds_DipGame, True)
    assert len(verbose_announcement.split()) > len(announcement_builds.split())