Module: check_mk
Branch: master
Commit: 746e36c4ccf2c1bc801dd3443c71fe8ed1968b89
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=746e36c4ccf2c1…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Dec 10 12:35:07 2018 +0100
OutputFunnel.flush() is an implementation detail.
Change-Id: I7b896c0f41d0012942b13dca4b62d8568c75fe9a
---
cmk/gui/htmllib.py | 15 ++-------------
tests/unit/cmk/gui/test_htmllib_OutputFunnel.py | 11 -----------
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index d5f9339..9e4758f 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -420,17 +420,6 @@ class OutputFunnel(object):
def _is_plugged(self):
return self.plug_level > -1
- # Pull the plug for a moment to allow the sink content to pass through.
- def flush(self):
- if not self._is_plugged():
- return None
-
- text = "".join(self.plug_text[self.plug_level])
- self.plug_text[self.plug_level] = []
- self.plug_level -= 1
- self.write(text)
- self.plug_level += 1
-
# Get the sink content in order to do something with it.
def drain(self):
if not self._is_plugged():
@@ -444,9 +433,9 @@ class OutputFunnel(object):
if not self._is_plugged():
return
- self.flush()
- self.plug_text.pop()
+ text = "".join(self.plug_text.pop())
self.plug_level -= 1
+ self.write(text)
def unplug_all(self):
while self._is_plugged():
diff --git a/tests/unit/cmk/gui/test_htmllib_OutputFunnel.py
b/tests/unit/cmk/gui/test_htmllib_OutputFunnel.py
index 9bedae7..bfb6025 100644
--- a/tests/unit/cmk/gui/test_htmllib_OutputFunnel.py
+++ b/tests/unit/cmk/gui/test_htmllib_OutputFunnel.py
@@ -53,17 +53,6 @@ def test_output_funnel_drain(html):
assert html.written == "B"
-def test_output_funnel_flush(html):
- html.plug()
- html.write("A")
- assert html.plug_text == [["A"]]
- html.flush()
- assert html.written == "A"
- assert html.plug_text == [[]]
- html.unplug()
- assert html.written == "A"
-
-
def test_output_funnel_context_nesting(html):
html.write("A")
assert html.written == "A"