1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-23 18:12:20 +00:00

update to pass tests with community plugins

This commit is contained in:
J. Fernando Sánchez
2023-09-22 23:28:19 +02:00
parent 5b28b6d1b4
commit 4f95fbcbd1
15 changed files with 206 additions and 78 deletions

View File

@@ -209,8 +209,8 @@ class BlueprintsTest(TestCase):
"""
# First, we split by sentence twice. Each call should generate 3 additional entries
# (one per sentence in the original).
resp = self.client.get('/api/split/split?i=The first sentence. The second sentence.'
'\nA new paragraph&delimiter=sentence&verbose')
resp = self.client.get('/api/split/split?i=The first sentence. The second sentence.%0A'
'A new paragraph&delimiter=sentence&verbose')
js = parse_resp(resp)
assert len(js['activities']) == 2
assert len(js['entries']) == 7
@@ -218,9 +218,8 @@ class BlueprintsTest(TestCase):
# Now, we split by sentence. This produces 3 additional entries.
# Then, we split by paragraph. This should create 2 additional entries (One per paragraph
# in the original text)
resp = self.client.get('/api/split/split?i=The first sentence. The second sentence.'
'\nA new paragraph&0.delimiter=sentence'
'&1.delimiter=paragraph&verbose')
resp = self.client.get('/api/split/split?i=The first sentence. The second sentence.%0AA new paragraph'
'&0.delimiter=sentence&1.delimiter=paragraph&verbose')
# Calling dummy twice, should return the same string
self.assertCode(resp, 200)
js = parse_resp(resp)

View File

@@ -255,3 +255,9 @@ class ExtensionsTest(TestCase):
self.senpy.analyse(r3)
assert len(r3.entries[0].emotions) == 1
r3.jsonld()
def testDefaultPlugins(self):
'''The default set of plugins should all load'''
self.app = Flask('test_extensions')
self.examples_dir = os.path.join(os.path.dirname(__file__), '..', 'example-plugins')
self.senpy = Senpy(app=self.app, default_plugins=False, strict=True)