Add generator test

As @seuros commented in #2016, I added a test for generator.
Thank you!
we could have both assertion in the same file test 'worker is created and its test'