def test_longer():
 jobs = bg.BackgroundJobManager()
 j = jobs.new(sleeper, 0.1)
 nt.assert_equal(len(jobs.running), 1)
 nt.assert_equal(len(jobs.completed), 0)
 j.join()
 nt.assert_equal(len(jobs.running), 0)
 nt.assert_equal(len(jobs.completed), 1)

def test_longer ( ) : jobs = bg . BackgroundJobManager ( ) j = jobs . new ( sleeper , 0.1 ) nt . assert_equal ( len ( jobs . running ) , 1 ) nt . assert_equal ( len ( jobs . completed ) , 0 ) j . join ( ) nt . assert_equal ( len ( jobs . running ) , 0 ) nt . assert_equal ( len ( jobs . completed ) , 1 )
test control of longer-running jobs .