-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from InvalidLenni/create-.github-files
Add .github files
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[BUG]" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
We need the code and the error. | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Versions (please complete the following information):** | ||
- Libary version: [e.g alpha, beta, release] | ||
- Python version: [e.g 3.7, 3.8, 3.9] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from amari import api | ||
from api import AmariClient | ||
import pytest | ||
|
||
|
||
class TestEverything: | ||
async def check_client(self): | ||
try: | ||
_ = self.client | ||
except AttributeError: | ||
self.client = AmariClient(self.get_token()) | ||
|
||
@pytest.mark.asyncio | ||
async def test_users(self): | ||
"""Tests the fetching users function""" | ||
await self.check_client() | ||
|
||
await self.client.fetch_user(814233207515643974, 374147012599218176) | ||
await self.client.fetch_users( | ||
854118090173186058, ["854118090173186058", "107510319315697664", "249955383001481216"] | ||
) | ||
|
||
@pytest.mark.asyncio | ||
async def test_leaderboards(self): | ||
"""Tests the fetching leaderboards function""" | ||
await self.check_client() | ||
|
||
await self.client.fetch_leaderboard(854118090173186058, page=3, limit=100) | ||
await self.client.fetch_full_leaderboard(854118090173186058, weekly=True) | ||
|
||
@pytest.mark.asyncio | ||
async def test_rewards(self): | ||
"""Tests the fetching rewards function""" | ||
await self.check_client() | ||
|
||
await self.client.fetch_rewards(854118090173186058, page=1, limit=20) | ||
|
||
@pytest.mark.asyncio | ||
async def pytest_sessionfinish(self, session, exitstatus): | ||
"""Closes the session at the end of the tests""" | ||
await self.client.close() | ||
|
||
def get_token(self): | ||
with open(__file__[:-15] + "amari_secret", "r") as secret: | ||
return secret.read() |