diff options
author | 2019-10-12 12:44:16 +0200 | |
---|---|---|
committer | 2019-10-12 12:44:16 +0200 | |
commit | 42abcc5b3c3cc2846a7be8b0e2f5549d820e196e (patch) | |
tree | 6007dc3893f4a59204a7abd2c2af36682439ea37 /tests | |
parent | Update README.md (diff) |
Move `tests.test_resources` to `unittest`.
Diffstat (limited to 'tests')
-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) |