From 42abcc5b3c3cc2846a7be8b0e2f5549d820e196e Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sat, 12 Oct 2019 12:44:16 +0200 Subject: Move `tests.test_resources` to `unittest`. --- tests/test_resources.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_resources.py (limited to 'tests/test_resources.py') diff --git a/tests/test_resources.py b/tests/test_resources.py new file mode 100644 index 000000000..2fc36c697 --- /dev/null +++ b/tests/test_resources.py @@ -0,0 +1,16 @@ +import json +import unittest +from pathlib import Path + + +class ResourceValidationTests(unittest.TestCase): + """Validates resources used by the bot.""" + def test_stars_valid(self): + """The resource `bot/resources/stars.json` should contain a list of strings.""" + path = Path('bot', 'resources', 'stars.json') + content = path.read_text() + data = json.loads(content) + + self.assertIsInstance(data, list) + for name in data: + self.assertIsInstance(name, str) -- cgit v1.2.3