@@ -1584,10 +1584,10 @@ def test_pass_in_user(self):
15841584 if self .sg .server_caps .version and self .sg .server_caps .version < (5 , 3 , 17 ):
15851585 return
15861586
1587- sg = shotgun_api3 .Shotgun (self .config .server_url ,
1588- login = self .config .human_login ,
1589- password = self .config .human_password ,
1590- http_proxy = self .config .http_proxy )
1587+ sg = shotgun_api3 .Shotgun ( self .config .server_url ,
1588+ login = self .config .human_login ,
1589+ password = self .config .human_password ,
1590+ http_proxy = self .config .http_proxy )
15911591
15921592 initial = sg .find_one ('Project' , [['id' ,'is' ,self .project ['id' ]]], ['last_accessed_by_current_user' ])
15931593
@@ -1600,6 +1600,25 @@ def test_pass_in_user(self):
16001600 if initial :
16011601 assert (initial ['last_accessed_by_current_user' ] < current ['last_accessed_by_current_user' ])
16021602
1603+ def test_sudo_as_user (self ):
1604+ if self .sg .server_caps .version and self .sg .server_caps .version < (5 , 3 , 17 ):
1605+ return
1606+
1607+ sg = shotgun_api3 .Shotgun ( self .config .server_url ,
1608+ self .config .script_name ,
1609+ self .config .api_key ,
1610+ http_proxy = self .config .http_proxy ,
1611+ sudo_as_login = self .config .human_login )
1612+
1613+ initial = sg .find_one ('Project' , [['id' ,'is' ,self .project ['id' ]]], ['last_accessed_by_current_user' ])
1614+
1615+ sg .update_project_last_accessed (self .project )
1616+
1617+ current = sg .find_one ('Project' , [['id' ,'is' ,self .project ['id' ]]], ['last_accessed_by_current_user' ])
1618+ self .assertNotEqual ( initial , current )
1619+ # it's possible initial is None
1620+ if initial :
1621+ assert (initial ['last_accessed_by_current_user' ] < current ['last_accessed_by_current_user' ])
16031622
16041623def _has_unicode (data ):
16051624 for k , v in data .items ():
0 commit comments