diff options
author | 2019-10-13 11:40:12 +0200 | |
---|---|---|
committer | 2019-10-13 11:40:12 +0200 | |
commit | 88d8f62457681610302aac29053bde00e9a9abfd (patch) | |
tree | dfef5bfc9a8bf549896c3b15485fd727c4045cc1 | |
parent | Merge pull request #520 from python-discord/sync-cog-to-unittest (diff) | |
parent | Add subTest + move test_resource to resources subdir (diff) |
Merge branch 'resources-to-unittest' into unittest-migration
-rw-r--r-- | tests/bot/resources/test_resources.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/bot/resources/test_resources.py b/tests/bot/resources/test_resources.py new file mode 100644 index 000000000..73937cfa6 --- /dev/null +++ b/tests/bot/resources/test_resources.py @@ -0,0 +1,17 @@ +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: + with self.subTest(name=name): + self.assertIsInstance(name, str) |