persephone-tools / persephone-web-API

Web API for use with the Persephone library
GNU Affero General Public License v3.0
8 stars 2 forks source link

Cannot create multiple corpuses because of duplicate labels #160

Closed aapeliv closed 5 years ago

aapeliv commented 5 years ago

It returns an error "Invalid corpus provided" (also see #159). Digging a bit deeper, the error comes from it trying to create new labels each time, but these are marked as unique in SQL.

(sqlite3.IntegrityError) UNIQUE constraint failed: label.label [SQL: 'INSERT INTO label (label) VALUES (?)'] [parameters: ('v̩',)] (Background on this error at: http://sqlalche.me/e/gkpj)
shuttle1987 commented 5 years ago

This is definitely a bug, thanks for the error report. There's a definite lack of test cases here which has been caused by a lack of good setup for database based tests and fixtures

shuttle1987 commented 5 years ago

@aapeliv What sort of input caused this bug to be exposed? I'd like to write a regression test using the exact input you had here.