Skip to content

Commit e2e6488

Browse files
committed
fix help unit tests
1 parent e077af9 commit e2e6488

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

tests/unit/test_help.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
import io
2+
import sys
3+
14
from ..testcase import TestCase
25

36
class TestHelp(TestCase):
47

58
def test_get_function_list(self):
6-
h = self.geosupport.help()
9+
h = self.geosupport.help(return_as_string=True)
710

811
self.assertTrue("1" in h)
912
self.assertTrue("bbl" in h)
1013

1114
def test_function_help(self):
12-
h = self.geosupport.help("bbl")
15+
h = self.geosupport.help("bbl", return_as_string=True)
1316

1417
self.assertTrue("Function BL processes" in h)
1518
self.assertTrue("Input: Borough" in h)
@@ -18,6 +21,17 @@ def test_function_help(self):
1821
self.assertTrue("Mode Switch" in h)
1922

2023
def test_invalid_function_help(self):
21-
h = self.geosupport.help("fake")
24+
h = self.geosupport.help("fake", return_as_string=True)
2225

2326
self.assertEqual(h, "Function 'fake' does not exist.")
27+
28+
def test_print(self):
29+
h = io.StringIO()
30+
sys.stdout = h
31+
32+
o = self.geosupport.help()
33+
34+
sys.stdout = sys.__stdout__
35+
36+
self.assertTrue("bbl" in h.getvalue())
37+
self.assertTrue(o is None)

0 commit comments

Comments
 (0)