# Path: sampletester/testenv.py
# class Base:
#   def __init__(self, name='#Base', description=''):
#   def name(self):
#   def setup(self):
#   def teardown(self):
#   def get_call(self, *args, **kwargs):
#   def get_symbol(self, symbol):
#   def get_testcase_settings(self):
# def process_args(*args, **kwargs):
# def quote(s: str):


import re
import os
from sampletester import testenv
#      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.



class PythonSamplesEnvironment(testenv.Base):

  def __init__(self, path: str):
    super().__init__('PythonSamplesEnvironment')
    self.path = path
    self.sample_rpc_paths = {}
    for api_dir in os.listdir(path):
      api_path = os.path.join(
          path,
          api_dir)  # ...../googleapis/artman-genfiles/python/my-language-v1
      if not os.path.isdir(api_path):
        continue
      versioned_api = os.path.basename(api_path)  # my-language-v1
      parts = versioned_api.split('-')
      version_str = parts.pop()  # v1
      api_str = '-'.join(parts)  # my-language
      api_name = ''.join([word.capitalize() for word in parts])  # MyLanguage
      samples_rpc_dir = os.path.join(
          api_path, 'samples', 'google', 'cloud', '_'.join(
              [api_str, version_str]), 'gapic'

# Path: sampletester/testenv.py
# class Base:
#   def __init__(self, name='#Base', description=''):
#   def name(self):
#   def setup(self):
#   def teardown(self):
#   def get_call(self, *args, **kwargs):
#   def get_symbol(self, symbol):
#   def get_testcase_settings(self):
# def process_args(*args, **kwargs):
# def quote(s: str):


# Path: sampletester/convention/cloud/cloud.py
import re
import os
from sampletester import testenv

#      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.



class PythonSamplesEnvironment(testenv.Base):

  def __init__(self, path: str):
    super().__init__('PythonSamplesEnvironment')
    self.path = path
    self.sample_rpc_paths = {}
    for api_dir in os.listdir(path):
      api_path = os.path.join(
          path,
          api_dir)  # ...../googleapis/artman-genfiles/python/my-language-v1
      if not os.path.isdir(api_path):
        continue
      versioned_api = os.path.basename(api_path)  # my-language-v1
      parts = versioned_api.split('-')
      version_str = parts.pop()  # v1
      api_str = '-'.join(parts)  # my-language
      api_name = ''.join([word.capitalize() for word in parts])  # MyLanguage
      samples_rpc_dir = os.path.join(
          api_path, 'samples', 'google', 'cloud', '_'.join(
              [api_str, version_str]), 'gapic'

      )  # ...../googleapis/artman-genfiles/python/my-language-v1/samples/google/cloud/my-language_v1/gapic