From dcc4ddf11b6976e35d114e3e3ab834b5ef5f9ed3 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 21 Mar 2016 16:53:11 +0100 Subject: [PATCH] Add a test for \r\n Fix #458 --- tests/modules/iou/test_iou_vm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/modules/iou/test_iou_vm.py b/tests/modules/iou/test_iou_vm.py index 4eb63019..1e8ec0fc 100644 --- a/tests/modules/iou/test_iou_vm.py +++ b/tests/modules/iou/test_iou_vm.py @@ -118,6 +118,7 @@ def test_start(loop, vm, monkeypatch): assert vm.is_running() assert vm.command_line == ' '.join(mock_exec.call_args[0]) + def test_start_with_iourc(loop, vm, monkeypatch, tmpdir): fake_file = str(tmpdir / "iourc") @@ -412,6 +413,14 @@ def test_iourc_content(vm): assert f.read() == "test" +def test_iourc_content_fix_carriage_return(vm): + + vm.iourc_content = "test\r\n12" + + with open(os.path.join(vm.temporary_directory, "iourc")) as f: + assert f.read() == "test\n12" + + def test_extract_configs(vm): assert vm.extract_configs() == (None, None)