Skip to content

Commit

Permalink
Update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jun 25, 2024
1 parent 16bcf6a commit 04027d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/backend/InvenTree/plugin/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,17 @@ def test_broken_samples(self):
# Reload to rediscover plugins
registry.reload_plugins(full_reload=True, collect=True)

self.assertEqual(len(registry.errors), 3)
self.assertEqual(len(registry.errors), 2)

# There should be at least one discovery error in the module `broken_file`
self.assertGreater(len(registry.errors.get('discovery')), 0)
self.assertEqual(
registry.errors.get('discovery')[0]['broken_file'],
"name 'bb' is not defined",
)

# There should be at least one load error with an intentional KeyError
self.assertGreater(len(registry.errors.get('load')), 0)
self.assertGreater(len(registry.errors.get('init')), 0)
self.assertEqual(
registry.errors.get('load')[0]['broken_sample'], "'This is a dummy error'"
registry.errors.get('init')[0]['broken_sample'], "'This is a dummy error'"
)

0 comments on commit 04027d1

Please sign in to comment.