# Path: studio/model.py
# def reset_storage_providers():
# def get_config(config_file=None):
# def get_db_provider(config=None, blocking_auth=True):
# def get_queue(
#         queue_name=None,
#         cloud=None,
#         config=None,
#         logger=None,
#         close_after=None,
#         verbose=10):
# def shutdown_queue(queue, logger=None, delete_queue=True):
# def get_worker_manager(config, cloud=None, verbose=10):
# 
# Path: studio/extra_util.py
# def has_aws_credentials():
#     artifact_store = storage_setup.get_storage_artifact_store()
#     if artifact_store is None:
#         return False
#     storage_handler = artifact_store.get_storage_handler()
#     if storage_handler.type == StorageType.storageS3:
#         storage_client = storage_handler.get_client()
#         return storage_client._request_signer._credentials is not None
#     else:
#         return False


import unittest
import subprocess
import time
import os
import tempfile
import uuid
from random import randint
from studio import model
from model_test import get_test_experiment
from studio.extra_util import has_aws_credentials
from env_detect import on_gcp, on_aws




@unittest.skipIf(
    not on_gcp(),
    'User indicated not on gcp')
class UserIndicatedOnGCPTest(unittest.TestCase):
    def test_on_enviornment(self):
        self.assertTrue('GOOGLE_APPLICATION_CREDENTIALS' in os.environ.keys())


@unittest.skipIf(
    (not on_gcp()) or
    'GOOGLE_APPLICATION_CREDENTIALS' not in os.environ.keys(),
    'Skipping due to userinput or GCP Not detected')
class HTTPProviderTest(unittest.TestCase):

    _mutliprocess_shared_ = True

    @classmethod
    def setUpClass(self):
        print("Starting up the API server")
        self.port = randint(5000, 9000)

        # self.app.run(port=self.port, debug=True)
        # self.serverp.start()

# Path: studio/model.py
# def reset_storage_providers():
# def get_config(config_file=None):
# def get_db_provider(config=None, blocking_auth=True):
# def get_queue(
#         queue_name=None,
#         cloud=None,
#         config=None,
#         logger=None,
#         close_after=None,
#         verbose=10):
# def shutdown_queue(queue, logger=None, delete_queue=True):
# def get_worker_manager(config, cloud=None, verbose=10):
# 
# Path: studio/extra_util.py
# def has_aws_credentials():
#     artifact_store = storage_setup.get_storage_artifact_store()
#     if artifact_store is None:
#         return False
#     storage_handler = artifact_store.get_storage_handler()
#     if storage_handler.type == StorageType.storageS3:
#         storage_client = storage_handler.get_client()
#         return storage_client._request_signer._credentials is not None
#     else:
#         return False


# Path: tests/http_provider_test.py
import unittest
import subprocess
import time
import os
import tempfile
import uuid
from random import randint
from studio import model
from model_test import get_test_experiment
from studio.extra_util import has_aws_credentials
from env_detect import on_gcp, on_aws





@unittest.skipIf(
    not on_gcp(),
    'User indicated not on gcp')
class UserIndicatedOnGCPTest(unittest.TestCase):
    def test_on_enviornment(self):
        self.assertTrue('GOOGLE_APPLICATION_CREDENTIALS' in os.environ.keys())


@unittest.skipIf(
    (not on_gcp()) or
    'GOOGLE_APPLICATION_CREDENTIALS' not in os.environ.keys(),
    'Skipping due to userinput or GCP Not detected')
class HTTPProviderTest(unittest.TestCase):

    _mutliprocess_shared_ = True

    @classmethod
    def setUpClass(self):
        print("Starting up the API server")
        self.port = randint(5000, 9000)

        # self.app.run(port=self.port, debug=True)
        # self.serverp.start()

        self.server_config_file = os.path.join(