File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,21 @@ def test_v1_job_fallback(self):
440440 self .assertEqual (n_events , n_preview , n_results )
441441
442442 def test_published_author_fields (self ):
443+ def has_author ():
444+ jobs = self .service .jobs .list (name = self .job .name )
445+ return (
446+ len (jobs ) == 1
447+ and jobs [0 ].state .author is not None
448+ and jobs [0 ].state .author .name is not None
449+ )
450+
451+ # It takes a while until the author field becomes available after
452+ # creaton of a job, wait until it is available, before running the asserts.
453+ self .assertEventuallyTrue (
454+ has_author ,
455+ timeout = 5 ,
456+ )
457+
443458 jobs = self .service .jobs .list (name = self .job .name )
444459 self .assertEqual (len (jobs ), 1 )
445460 self .assertEqual (jobs [0 ].state .author .name , self .service .username )
You can’t perform that action at this time.
0 commit comments