From 33bcced4a2c74157a4c51463190b8c30b3fd6cc1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Jun 2016 10:11:59 +0200 Subject: [PATCH] Add a test for AppendLineParser.clear --- tests/unit/misc/test_lineparser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index 456457741..6789e78a8 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -147,6 +147,12 @@ class TestAppendLineParser: lineparser.save() assert lineparser._data == self._get_expected(new_data) + def test_clear(self, lineparser): + lineparser.new_data = ['this', 'should', 'be', 'cleared'] + lineparser.clear() + lineparser.save() + assert lineparser._data == "" + def test_iter_without_open(self, lineparser): """Test __iter__ without having called open().""" with pytest.raises(ValueError):