Skip to content

Commit

Permalink
Added test if exists registry and check raise
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Jul 11, 2019
1 parent 7a0a028 commit 5f443c5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bothub/api/v1/tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,36 @@ def test_with_entities(self):
len(content_data.get('entities')),
1)

def test_exists_registry(self):
text = 'hi'
intent = 'greet'
self.request(
self.owner_token,
{
'repository': str(self.repository.uuid),
'text': text,
'intent': intent,
'entities': [],
})

response, content_data = self.request(
self.owner_token,
{
'repository': str(self.repository.uuid),
'text': text,
'intent': intent,
'entities': [],
})

self.assertEqual(
content_data.get('non_field_errors')[0],
'Intention and Sentence already exists'
)

self.assertEqual(
response.status_code,
status.HTTP_400_BAD_REQUEST)

def test_with_entities_with_label(self):
response, content_data = self.request(
self.owner_token,
Expand Down

0 comments on commit 5f443c5

Please sign in to comment.