diff options
-rw-r--r-- | tests/test_resources.py | 16 |
1 files changed, 16 insertions, 0 deletions
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) |