Skip to content

Commit

Permalink
adds Report test
Browse files Browse the repository at this point in the history
  • Loading branch information
withtwoemms committed Jan 4, 2024
1 parent 4e2c6ab commit e3c81d5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/pokedex/db/test_models.py
@@ -0,0 +1,21 @@
import json
from unittest import TestCase

from pokedex.db.models import Report


class TestReport(TestCase):

def test_report_representation(self):
results = {
"https://pokeapi.co/api/v2/pokemon/1/": True,
"https://pokeapi.co/api/v2/pokemon/2/": True,
"https://pokeapi.co/api/v2/pokemon/3/": False,
}
report = Report(persisted=results)
expected_report = json.dumps(
{"persisted": results, "count": len(results)},
indent=4
)

assert str(report) == expected_report

0 comments on commit e3c81d5

Please sign in to comment.