add integration test for plugin

This commit is contained in:
Matthias 2022-01-09 03:34:27 +01:00
parent cc8948c708
commit f9742ab41d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -0,0 +1,20 @@
""" Unit tests for action caller sample"""
from django.test import TestCase
from plugin import plugin_registry
class SampleApiCallerPluginTests(TestCase):
""" Tests for SampleApiCallerPluginTests """
def test_return(self):
"""check if the external api call works"""
# The plugin should be defined
self.assertIn('sample-api-caller', plugin_registry.plugins)
plg = plugin_registry.plugins['sample-api-caller']
self.assertTrue(plg)
# do an api call
result = plg.get_external_url()
self.assertTrue(result)
self.assertIn('data', result,)