def test_simulation_set_outfile(self):
    self.sim.set_output_file('/tmp/test')
    assert_equal(self.sim.outfile, '/tmp/test')
    assert (self.sim.out is None), 'Sim.out is set up'
    self.sim.is_running = True
    self.sim.set_output_file('/tmp/test')
    assert (self.sim.out is not None), 'Sim.out is not set up'
    simulation._close_out_fd(self.sim)
    assert (self.sim.out is None), 'Sim.out was not closed'
    assert_equal(self.sim.out_opened, False)
    simulation._open_out_fd(self.sim)
    assert (self.sim.out is not None), 'Sim.out was not opened'
    assert_equal(self.sim.out_opened, True)
    self.sim.set_output_file('/tmp/test2')
    simulation._open_out_fd(self.sim)
    assert (self.sim.out is not None), 'Sim.out was not opened'
    assert_equal(self.sim.out_opened, True)
def test_simulation_set_outfile(self):
    self.sim.set_output_file('/tmp/test')
    assert_equal(self.sim.outfile, '/tmp/test')
    assert (self.sim.out is None), 'Sim.out is set up'
    self.sim.is_running = True
    self.sim.set_output_file('/tmp/test')
    assert (self.sim.out is not None), 'Sim.out is not set up'
    simulation._close_out_fd(self.sim)
    assert (self.sim.out is None), 'Sim.out was not closed'
    assert_equal(self.sim.out_opened, False)
    simulation._open_out_fd(self.sim)
    assert (self.sim.out is not None), 'Sim.out was not opened'
    assert_equal(self.sim.out_opened, True)
    self.sim.set_output_file('/tmp/test2')
    simulation._open_out_fd(self.sim)
    assert (self.sim.out is not None), 'Sim.out was not opened'
    assert_equal(self.sim.out_opened, True)