def METHOD_NAME():
    import os
    tpath = testing.setup_unit_test_output_directory('pwscf_simulation','test_check_sim_status',**pseudo_inputs)
    sim = get_pwscf_sim('scf')
    assert(sim.locdir.rstrip('/')==os.path.join(tpath,'scf').rstrip('/'))
    if not os.path.exists(sim.locdir):
        os.makedirs(sim.locdir)
    #end if
    assert(not sim.finished)
    try:
        sim.check_sim_status()
    except IOError:
        None
    except Exception as e:
        failed(str(e))
    #end try
    assert(not sim.finished)
    out_path = os.path.join(tpath,'scf',sim.outfile)
    out_text = ''
    outfile = open(out_path,'w')
    outfile.write(out_text)
    outfile.close()
    assert(os.path.exists(out_path))
    sim.check_sim_status()
    assert(not sim.finished)
    out_text = 'JOB DONE'
    outfile = open(out_path,'w')
    outfile.write(out_text)
    outfile.close()
    assert(out_text in open(out_path,'r').read())
    sim.check_sim_status()
    assert(sim.finished)
    assert(not sim.failed)
    clear_all_sims()
    restore_nexus()