'Check that the certificate generation task was added to the queue.'

def _assert_certs_in_queue(self, mock_queue, expected_num):

    certs_in_queue = [call_args[0] for (call_args, __) in mock_queue.call_args_list]
    self.assertEqual(len(certs_in_queue), expected_num)
    for cert in certs_in_queue:
        self.assertTrue(isinstance(cert, ExampleCertificate))
