Skip to content

Commit

Permalink
Fixed path of temporary chart file in chart command
Browse files Browse the repository at this point in the history
  • Loading branch information
d-stoll committed Jun 7, 2021
1 parent dbf3763 commit d29ceb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions stonkmaster/commands/ChartCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions tests/commands/test_price_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://gmefloor.com/>"
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: <https://gmefloor.com/>"
assert re.match(matching_regex, discord_ctx.messages.pop(0))
assert re.match(matching_regex, discord_ctx.messages.pop())


@pytest.mark.asyncio
Expand Down

0 comments on commit d29ceb5

Please sign in to comment.