Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUpClass(cls):
"""
Load json data used for testing
"""
cls.samples = []
for filename in os.listdir(JSON_DIR):
full_path = os.path.join(JSON_DIR, filename)
if filename.endswith('.json'):
with open(full_path, 'r') as fh:
word_json = json.load(fh)
word_obj = duden.get(word_json['urlname'])
cls.samples.append((word_json, word_obj))
def test_get(self):
"""
Test if the word laufen can be parsed
"""
word = 'laufen'
dword = duden.get('laufen')
self.assertEqual(word, dword.title)