def test_update_job_status():
    under_test = CommandChannel("localhost:42/some_topic")
    job_id = "some_id"
    new_status = JobStatus(job_id)
    assert len(under_test.list_jobs()) == 0
    assert under_test.get_job(job_id) is None
    under_test.status_queue.put(new_status)
    under_test.update_workers()
    assert len(under_test.list_jobs()) == 1
    assert under_test.get_job(job_id).job_id == job_id
    under_test.stop_thread()
def test_add_job_id():
    under_test = CommandChannel("localhost:42/some_topic")
    assert len(under_test.list_jobs()) == 0
    job_id_1 = "some_job_id_1"
    assert under_test.get_job(job_id_1) is None
    under_test.add_job_id(job_id_1)
    assert len(under_test.list_jobs()) == 1
    assert under_test.get_job(job_id_1).job_id == job_id_1
    job_id_2 = "some_job_id_2"
    assert under_test.get_job(job_id_2) is None
    under_test.add_job_id(job_id_2)
    assert len(under_test.list_jobs()) == 2
    assert under_test.get_job(job_id_2).job_id == job_id_2
    under_test.stop_thread()