@@ -29,19 +29,27 @@ def environ() -> Environ:
2929 """
3030 try :
3131 return Environ (os .environ ['LABELBOX_TEST_ENVIRON' ])
32- # TODO: for some reason all other environs can be set but
33- # this one cannot in github actions
34- #return Environ.PROD
3532 except KeyError :
3633 raise Exception (f'Missing LABELBOX_TEST_ENVIRON in: { os .environ } ' )
3734
3835
36+ def graphql_url (environ : str ) -> str :
37+ if environ == Environ .PROD :
38+ return 'https://api.labelbox.com/graphql'
39+ return 'https://staging-api.labelbox.com/graphql'
40+
41+
42+ def testing_api_key (environ : str ) -> str :
43+ if environ == Environ .PROD :
44+ return os .environ ["LABELBOX_TEST_API_KEY_PROD" ]
45+ return os .environ ["LABELBOX_TEST_API_KEY_STAGING" ]
46+
47+
3948class IntegrationClient (Client ):
4049
41- def __init__ (self ):
42- api_url = os .environ ["LABELBOX_TEST_ENDPOINT" ]
43- api_key = os .environ ["LABELBOX_TEST_API_KEY" ]
44- #"https://staging-api.labelbox.com/graphql")
50+ def __init__ (self , environ : str ) -> None :
51+ api_url = graphql_url (environ )
52+ api_key = testing_api_key (environ )
4553 super ().__init__ (api_key , api_url )
4654
4755 self .queries = []
@@ -54,8 +62,8 @@ def execute(self, query, params=None, check_naming=True, **kwargs):
5462
5563
5664@pytest .fixture
57- def client ():
58- return IntegrationClient ()
65+ def client (environ : str ):
66+ return IntegrationClient (environ )
5967
6068
6169@pytest .fixture
@@ -105,10 +113,9 @@ def label_pack(project, rand_gen):
105113
106114@pytest .fixture
107115def iframe_url (environ ) -> str :
108- return {
109- Environ .PROD : 'https://editor.labelbox.com' ,
110- Environ .STAGING : 'https://staging-editor.labelbox.com' ,
111- }[environ ]
116+ if environ == Environ .PROD :
117+ return 'https://editor.labelbox.com'
118+ return 'https://staging.labelbox.dev/editor'
112119
113120
114121@pytest .fixture
0 commit comments