From eeb198ac82aff2b3ff0990ab295f2e3b9a65bb49 Mon Sep 17 00:00:00 2001 From: rainiera Date: Mon, 19 Jun 2017 20:22:48 -0700 Subject: [PATCH 1/2] Add 'phrases' to ALLOWED_FIELDS and fix relevant test --- scaleapi/__init__.py | 2 +- tests/test_client.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 25480f0..e6e0aa7 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -20,7 +20,7 @@ 'lineannotation': {'attachment', 'attachment_type', 'instruction', 'objects_to_annotate', 'with_labels', 'examples'}, 'datacollection': {'attachment', 'attachment_type', 'fields'}, - 'audiotranscription': {'attachment', 'attachment_type', 'verbatim'}} + 'audiotranscription': {'attachment', 'attachment_type', 'verbatim', 'phrases'}} SCALE_ENDPOINT = 'https://api.scaleapi.com/v1/' DEFAULT_LIMIT = 100 DEFAULT_OFFSET = 0 diff --git a/tests/test_client.py b/tests/test_client.py index e266ffc..014961a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -186,7 +186,8 @@ def test_audiotranscription_ok(): callback_url='http://www.example.com/callback', attachment_type='audio', attachment='https://storage.googleapis.com/deepmind-media/pixie/knowing-what-to-say/second-list/speaker-3.wav', - verbatim=False + verbatim=False, + phrases=['avocado', 'stone'] ) From 03b11b6c958809bc76b5e2d6b6971a3b2c372979 Mon Sep 17 00:00:00 2001 From: rainiera Date: Mon, 19 Jun 2017 21:05:11 -0700 Subject: [PATCH 2/2] Mark task/phonecall endpoint tests as skipped for now --- tests/test_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 014961a..3c749b9 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -62,6 +62,7 @@ def test_transcription_fail(): attachment_type='website') +@pytest.mark.skip(reason="Deprecated at the moment") def test_phonecall_ok(): task = client.create_phonecall_task( callback_url='http://www.example.com/callback', @@ -73,6 +74,7 @@ def test_phonecall_ok(): choices=['He is happy', 'He is not happy']) +@pytest.mark.skip(reason="Deprecated at the moment") def test_phonecall_fail(): with pytest.raises(scaleapi.ScaleInvalidRequest): client.create_phonecall_task(