From d29ceb57d550749653e1c6eda695686e1f7597f9 Mon Sep 17 00:00:00 2001 From: d-stoll Date: Mon, 7 Jun 2021 19:11:06 +0200 Subject: [PATCH] Fixed path of temporary chart file in chart command --- stonkmaster/commands/ChartCommand.py | 4 ++-- tests/commands/test_price_command.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stonkmaster/commands/ChartCommand.py b/stonkmaster/commands/ChartCommand.py index c2500ba..9f75403 100644 --- a/stonkmaster/commands/ChartCommand.py +++ b/stonkmaster/commands/ChartCommand.py @@ -27,8 +27,8 @@ async def run(self, ctx, arg): candlestick.update_layout(xaxis_rangeslider_visible=False, title=chart_title) candlestick.update_yaxes(tickprefix='$') - candlestick.write_image(f"/tmp/the-stonk-master/{info['symbol']}.png") - with open(f"/tmp/the-stonk-master/{info['symbol']}.png", 'rb') as f: + candlestick.write_image(f"/tmp/{info['symbol']}.png") + with open(f"/tmp/{info['symbol']}.png", 'rb') as f: picture = discord.File(f) await ctx.send(file=picture) diff --git a/tests/commands/test_price_command.py b/tests/commands/test_price_command.py index 721422c..8dc8916 100644 --- a/tests/commands/test_price_command.py +++ b/tests/commands/test_price_command.py @@ -16,11 +16,11 @@ async def test_price_gme(): ) if is_market_closed(): assert discord_ctx.messages.pop() == "Market is currently **closed**" + else: + gme_special_msg = "Wennst ned woasd, wannst GME vakaffa wuisd, kosd de do orientiern: " + assert gme_special_msg == discord_ctx.messages.pop() - assert re.match(matching_regex, discord_ctx.messages.pop(0)) - - matching_regex = "Wennst ned woasd, wannst GME vakaffa wuisd, kosd de do orientiern: " - assert re.match(matching_regex, discord_ctx.messages.pop(0)) + assert re.match(matching_regex, discord_ctx.messages.pop()) @pytest.mark.asyncio