1from UM.FileHandler.FileWriter import FileWriter
2import pytest
3import io
4
5def test_getAddToRecentFiles():
6    writer = FileWriter(add_to_recent_files = True)
7    assert writer.getAddToRecentFiles()
8
9    other_writer = FileWriter(add_to_recent_files = False)
10    assert not other_writer.getAddToRecentFiles()
11
12
13def test_write():
14    writer = FileWriter()
15    with pytest.raises(Exception):
16        writer.write(io.StringIO(), "Some data to write")
17
18
19def test_information():
20    writer = FileWriter()
21    writer.setInformation("Some information about the writer")
22    assert writer.getInformation() == "Some information about the writer"