aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_resources.py
blob: 2fc36c697e7a6488f8eb326cc2710fc70789ad19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)