-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for sync and async response tests
- Loading branch information
1 parent
b9101d6
commit f6076e3
Showing
7 changed files
with
151 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
DeepAffects | ||
OpenAPI Specification of DeepAffects APIs | ||
OpenAPI spec version: 0.1.0 | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
# import apis into sdk package | ||
from .test_base_setup import DIR |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
DeepAffects | ||
OpenAPI spec version: v1 | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
import os | ||
import sys | ||
import unittest | ||
|
||
sys.path.insert(0, '/Users/VivekNimkarde/DeepAffects/deepaffects-python') | ||
import deepaffects | ||
from deepaffects import Audio | ||
from deepaffects.rest import ApiException | ||
from .test_base_setup import DIR | ||
import uuid | ||
|
||
|
||
class TestTextEmootion(unittest.TestCase): | ||
""" Text Emotion unit test stubs """ | ||
|
||
def setUp(self): | ||
deepaffects.configuration.api_key['apikey'] = os.environ['DEEPAFFECTS_API_KEY'] | ||
self.api = deepaffects.apis.emotion_api.EmotionApi() | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
def test_sync_diarize_audio_sample_text(self): | ||
""" | ||
Test case for Text Emotion | ||
Diarize text file | ||
""" | ||
|
||
body = { | ||
"content": "Awesome" | ||
} | ||
api_response = self.api.sync_text_recognise_emotion(body=body) | ||
print(api_response) | ||
assert api_response['response']['trust']> 0.8 | ||
def test_sync_diarize_audio_check_response_field_exists(self): | ||
""" | ||
Test case for Text Emotion | ||
Diarize text file | ||
""" | ||
|
||
body = { | ||
"content": "Awesome" | ||
} | ||
api_response = self.api.sync_text_recognise_emotion(body=body) | ||
print(api_response) | ||
assert api_response['response'] | ||
def test_sync_diarize_audio_check_version_field_exists(self): | ||
""" | ||
Test case for Text Emotion | ||
Diarize text file | ||
""" | ||
|
||
body = { | ||
"content": "Awesome" | ||
} | ||
api_response = self.api.sync_text_recognise_emotion(body=body) | ||
print(api_response) | ||
assert api_response['version'] | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |