# Path: mycroft/util/file_utils.py
# def get_temp_path(*args):
#     """Generate a valid path in the system temp directory.
# 
#     This method accepts one or more strings as arguments. The arguments are
#     joined and returned as a complete path inside the systems temp directory.
#     Importantly, this will not create any directories or files.
# 
#     Example usage: get_temp_path('mycroft', 'audio', 'example.wav')
#     Will return the equivalent of: '/tmp/mycroft/audio/example.wav'
# 
#     Args:
#         path_element (str): directories and/or filename
# 
#     Returns:
#         (str) a valid path in the systems temp directory
#     """
#     try:
#         path = os.path.join(tempfile.gettempdir(), *args)
#     except TypeError:
#         raise TypeError("Could not create a temp path, get_temp_path() only "
#                         "accepts Strings")
#     return path


import unittest
import unittest.mock as mock
import mycroft.audio
from shutil import rmtree
from threading import Thread
from time import sleep
from os.path import exists
from mycroft.util import create_signal, check_for_signal
from mycroft.util.file_utils import get_temp_path
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#




"""Tests for public audio service utils."""


done_waiting = False


def wait_while_speaking_thread():
    global done_waiting
    mycroft.audio.wait_while_speaking()
    done_waiting = True


class TestInterface(unittest.TestCase):
    def setUp(self):
        if exists(get_temp_path('mycroft')):

# Path: mycroft/util/file_utils.py
# def get_temp_path(*args):
#     """Generate a valid path in the system temp directory.
# 
#     This method accepts one or more strings as arguments. The arguments are
#     joined and returned as a complete path inside the systems temp directory.
#     Importantly, this will not create any directories or files.
# 
#     Example usage: get_temp_path('mycroft', 'audio', 'example.wav')
#     Will return the equivalent of: '/tmp/mycroft/audio/example.wav'
# 
#     Args:
#         path_element (str): directories and/or filename
# 
#     Returns:
#         (str) a valid path in the systems temp directory
#     """
#     try:
#         path = os.path.join(tempfile.gettempdir(), *args)
#     except TypeError:
#         raise TypeError("Could not create a temp path, get_temp_path() only "
#                         "accepts Strings")
#     return path


# Path: test/unittests/audio/test_utils.py
import unittest
import unittest.mock as mock
import mycroft.audio
from shutil import rmtree
from threading import Thread
from time import sleep
from os.path import exists
from mycroft.util import create_signal, check_for_signal
from mycroft.util.file_utils import get_temp_path

# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#




"""Tests for public audio service utils."""


done_waiting = False


def wait_while_speaking_thread():
    global done_waiting
    mycroft.audio.wait_while_speaking()
    done_waiting = True


class TestInterface(unittest.TestCase):
    def setUp(self):
        if exists(get_temp_path('mycroft')):

            rmtree(get_temp_path('mycroft'))