Skip to content

Commit

Permalink
Merge pull request #3 from InvalidLenni/create-.github-files
Browse files Browse the repository at this point in the history
Add .github files
  • Loading branch information
InvalidLenni committed Feb 3, 2022
2 parents f3c5e37 + fcfa04f commit 2778c6e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
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.
45 changes: 45 additions & 0 deletions tests/test_package.py
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()

0 comments on commit 2778c6e

Please sign in to comment.