summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 12d87218..53031567 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -154,3 +154,15 @@ def test_stdsim_clear(stdout_sim):
assert stdout_sim.getvalue() == my_str
stdout_sim.clear()
assert stdout_sim.getvalue() == ''
+
+def test_stdsim_getattr_exist(stdout_sim):
+ # Here the StdSim getattr is allowing us to access methods within StdSim
+ my_str = 'Hello World'
+ stdout_sim.write(my_str)
+ val_func = getattr(stdout_sim, 'getvalue')
+ assert val_func() == my_str
+
+def test_stdsim_getattr_noexist(stdout_sim):
+ # Here the StdSim getattr is allowing us to access methods defined by the inner stream
+ assert not stdout_sim.isatty()
+