from galileo_sdk import GalileoSdk # Must set env variables before running tests from galileo_sdk.business.objects import Job CONFIG = "development" galileo = GalileoSdk(config=CONFIG) job_list = galileo.jobs.list_jobs(sort_by="upload_date", sort_order="desc") jobid = "" self = galileo.profiles.self() def test_list_jobs(): assert isinstance(job_list[0], Job) galileo.disconnect()
def main(mode): myauth = AuthSdk() access_token, refresh_token, expiry_time = myauth.initialize() galileo = GalileoSdk(auth_token=access_token, refresh_token=refresh_token) @main.command() def exit(): os._exit(0) @main.command() def quit(): os._exit(0) @main.command() def logout(): token_file = os.path.join(os.path.expanduser("~"), ".galileo") if os.path.exists(token_file): try: os.remove(token_file) print("You have been logged out, see you next time") except Exception as e: print("Could not remove Auth Token file:", e) os._exit(0) click.echo(f"Connected to {galileo.backend}!") @main.command() @click.option("-w", "--workdir", type=str, multiple=False, help="Set a path to use as working directory.") @click.option('-v', '--view', is_flag=True, help="Print the current working directory for this session.") def workdir(workdir, view): """ Set the working directory for this CLI session. Files are uploaded to Missions relative to this path. """ if view: print("The working directory is currently ", os.environ.get("WORKDIR", "not set"), ".") if workdir: if os.path.exists(workdir): os.environ["WORKDIR"] = workdir print("Working directory is now ", os.environ["WORKDIR"], ".") else: print("This directory does not exist.") else: print( "Please provide an existing path to use as this session's working directory." ) universes_cli(main, galileo) cargobays_cli(main, galileo) #profiles_cli(main, galileo) lzs_cli(main, galileo) missions_cli(main, galileo) stations_cli(main, galileo)
from galileo_sdk import GalileoSdk, ResourcePolicy, StationRole, EVolumeAccess # Must set env variables before running tests CONFIG = "development" STATION_ID = "86a32c0b-bad0-456b-b41a-cb2bef9cdafb" LZ_ID = "Jaguar2121" ROLE_ID = "b67bb82c-f939-4c22-a341-9904675b7c92" galileo = GalileoSdk(config=CONFIG) user = galileo.profiles.self() MISSION_TYPE_ID = "stata_stata" def test_list_stations(): station_list = galileo.stations.list_stations() assert station_list is not None def test_create_and_delete_station(): station_details = galileo.stations.create_station( name="sdk_station_integration_test", userids=[], description="for testing", ) r_delete_station = galileo.stations.delete_station( station_details.stationid) assert "sdk_station_integration_test" == station_details.name assert station_details.stationid is not "" assert r_delete_station is True
from galileo_sdk import GalileoSdk import os # Must set env variables before running tests CONFIG = "development" galileo = GalileoSdk(config=CONFIG) second_galileo = GalileoSdk(config=CONFIG, username=str(os.environ["SECOND_GALILEO_USER"]), password=str( os.environ["SECOND_GALILEO_PASSWORD"])) """ Tests the "list_users" method. """ def test_list_users(): users = galileo.profiles.list_users() assert users is not None assert users[0].user_id is not None assert users[0].username is not None assert users[0].lz_ids is not None assert users[0].stored_cards is not None def test_get_profile(): self = galileo.profiles.self() assert self is not None assert self.lz_ids is not None assert self.stored_cards is not None