Skip to content

dialogflow: use unique names for all resources for tests to avoid col… #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dialogflow/cloud-client/context_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

from __future__ import absolute_import

import datetime
import os

import context_management
import detect_intent_texts

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
CONTEXT_ID = 'fake_context_for_testing'
SESSION_ID = 'test_session_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
CONTEXT_ID = 'test_context_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")


def test_create_context(capsys):
Expand Down
3 changes: 2 additions & 1 deletion dialogflow/cloud-client/detect_intent_audio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_audio import detect_intent_audio

DIRNAME = os.path.realpath(os.path.dirname(__file__))
PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
AUDIOS = [
'{0}/resources/book_a_room.wav'.format(DIRNAME),
'{0}/resources/mountain_view.wav'.format(DIRNAME),
Expand Down
3 changes: 2 additions & 1 deletion dialogflow/cloud-client/detect_intent_stream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_stream import detect_intent_stream

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
AUDIO_FILE_PATH = '{0}/resources/book_a_room.wav'.format(
os.path.realpath(os.path.dirname(__file__)),
)
Expand Down
3 changes: 2 additions & 1 deletion dialogflow/cloud-client/detect_intent_texts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_texts import detect_intent_texts

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
TEXTS = ["hello", "book a meeting room", "Mountain View",
"tomorrow", "10 AM", "2 hours", "10 people", "A", "yes"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_with_model_selection import \
detect_intent_with_model_selection

DIRNAME = os.path.realpath(os.path.dirname(__file__))
PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
AUDIOS = [
'{0}/resources/book_a_room.wav'.format(DIRNAME),
'{0}/resources/mountain_view.wav'.format(DIRNAME),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_with_sentiment_analysis import \
detect_intent_with_sentiment_analysis

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
TEXTS = ["hello", "book a meeting room", "Mountain View",
"tomorrow", "10 AM", "2 hours", "10 people", "A", "yes"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

from __future__ import absolute_import

import datetime
import os

from detect_intent_with_texttospeech_response import \
detect_intent_with_texttospeech_response

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
TEXTS = ["hello"]


Expand Down
3 changes: 2 additions & 1 deletion dialogflow/cloud-client/entity_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@

from __future__ import absolute_import

import datetime
import os

import entity_management
import entity_type_management

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
ENTITY_TYPE_DISPLAY_NAME = 'fake_entity_type_for_testing'
ENTITY_TYPE_DISPLAY_NAME = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
ENTITY_VALUE_1 = 'fake_entity_for_testing_1'
ENTITY_VALUE_2 = 'fake_entity_for_testing_2'
SYNONYMS = ['fake_synonym_for_testing_1', 'fake_synonym_for_testing_2']
Expand Down
3 changes: 2 additions & 1 deletion dialogflow/cloud-client/intent_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

from __future__ import absolute_import

import datetime
import os

import intent_management

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
INTENT_DISPLAY_NAME = 'fake_display_name_for_testing'
INTENT_DISPLAY_NAME = 'test_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
MESSAGE_TEXTS = [
'fake_message_text_for_testing_1',
'fake_message_text_for_testing_2'
Expand Down
7 changes: 4 additions & 3 deletions dialogflow/cloud-client/knowledge_base_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@

from __future__ import absolute_import

import datetime
import os

import detect_intent_knowledge
import document_management
import knowledge_base_management

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
SESSION_ID = 'test_session_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
TEXTS = ['Where is my data stored?']

KNOWLEDGE_BASE_NAME = 'fake_knowledge_base_name'
DOCUMENT_BASE_NAME = 'fake_document_name'
KNOWLEDGE_BASE_NAME = 'test_knowledge_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
DOCUMENT_BASE_NAME = 'test_document_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")


def test_create_knowledge_base(capsys):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

from __future__ import absolute_import

import datetime
import os

import entity_type_management
import session_entity_type_management

PROJECT_ID = os.getenv('GCLOUD_PROJECT')
SESSION_ID = 'fake_session_for_testing'
ENTITY_TYPE_DISPLAY_NAME = 'fake_display_name_for_testing'
SESSION_ID = 'test_session_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
ENTITY_TYPE_DISPLAY_NAME = 'test_type_' + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
ENTITY_VALUES = ['fake_entity_value_1', 'fake_entity_value_2']


Expand Down