File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,11 @@ def __getitem__(self, name):
4343 )
4444
4545 def __iter__ (self ):
46+ self .key_iter = iter (self .valid_roles )
4647 return self
4748
4849 def __next__ (self ):
49- try :
50- key = self .valid_roles [self .index ]
51- except :
52- raise StopIteration
53- self .index += 1
50+ key = next (self .key_iter )
5451 return getattr (self , key )
5552
5653
Original file line number Diff line number Diff line change 11import pytest
22
33from labelbox .schema .organization import ProjectRole
4- from conftest import Environ
54
65
76def test_org_invite (client , organization , environ ):
87 role = client .get_roles ()['LABELER' ]
98 dummy_email = "none@labelbox.com"
109 invite_limit = organization .invite_limit ()
1110
12- if environ == Environ . PROD :
11+ if environ . value == "prod" :
1312 user_limit = organization .user_limit ()
1413 assert invite_limit .remaining > 0 , "No invites available for the account associated with this key."
14+ elif environ .value != "staging" :
15+ raise ValueError (
16+ f"Expected tests to run against either prod or staging. Found { environ } "
17+ )
1518
1619 invite = organization .invite_user (dummy_email , role )
1720
18- if environ == Environ . PROD :
21+ if environ . value == "prod" :
1922 invite_limit_after = organization .invite_limit ()
2023 user_limit_after = organization .user_limit ()
2124 # One user added
You can’t perform that action at this time.
0 commit comments