Example #1
0
 def _is_a_test_pattern(self, pattern):
     segments = pattern.split('/')
     if len(segments) > 0:
         search_pattern = segments[len(segments) - 1]
         if api.TestNotebook._is_valid_test_name(search_pattern):
             return False
         return True
     logging.Fatal(""" Invalid argument.
              The value must be the full path to the test or a pattern """)
Example #2
0
 def _is_a_test_pattern(self, pattern):
     segments = pattern.split('/')
     if len(segments) > 0:
         search_pattern = segments[len(segments) - 1]
         if search_pattern.lower().startswith('test_'):
             return False
         return True
     logging.Fatal(""" Invalid argument.
              The value must be the full path to the test or a pattern """)
Example #3
0
    def get_uas_telemetry(self, cur_time):
        """Gets the UAS telemetry position at the given time.

        Args:
            cur_time: The time to get UAS telemetry at.
        Returns:
            A tuple (latitude, longitude, altitude_msl, uas_heading) where
            the values are in degrees, degrees, feet, degrees respectively.
        """
        logging.Fatal('Unimplemented.')
Example #4
0
def callScripts():
    for b in settings.buildOrder:
        if b in settings.buildScript:  # the application needs to be built
            cmd = settings.buildScript[b]
            log.info("callScripts: " + "building " + cmd)
            # construct the string to call the google cloud shell
            #           gc =  "gcloud --quiet compute ssh --ssh-key-file=~/.ssh/compute_engine jagadish@souvitestingdemo3 --zone us-central1-c --command " + "/home/kaushikaon/" + cmd
            gc = "/home/kaushikaon/" + cmd
            log.info("callScripts:command to be executed by google shell")
            log.info(gc)
            #            ret = os.system(gc)
            ret = 0
            if (ret == 0):
                print("cmd" + " ran successfully")
            else:
                log.Fatal("Build Failed")
                return False
    return True
Example #5
0
import json
import requests
import os
import logging

api_base_url = "https://api.adoptapet.com/search/pets_at_shelter?key="
# api_token = os.environ['ADOPTAPET_API_KEY']
api_key = '54188660446c78dd431e966d72efbf86' # temp

api_version = "v=2"
api_output = "output=json"
api_shelter_id = "shelter_id=79570"

url = api_base_url + api_token + "&" + api_version + \
    "&" + api_output + "&" + api_shelter_id

response = requests.get(url)
if response.status_code != 200:
    logging.Fatal("Could not complete the GET request")
else:
    json_response = json.loads(response.content.decode('utf-8'))
    print("Status: " + json_response['status'])

print("\nPrinting pet names ...\n")

for pet in json_response['pets']:
    name = pet['pet_name']
    id = pet['pet_id']
    print(f'Name: {name}\t ID: {id}')