Skip to content

Commit

Permalink
Add regression test for verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
job committed Dec 4, 2017
1 parent ffa79cf commit 3554065
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ def test_14_maxlength(self):
agg_main()
self.assertEqual(sys.stdout.getvalue(), '10.0.0.0/24\n')

def test_15_verbose(self):
stub_stdin(self, '10.0.0.0/24 10.0.1.0/24 172.16.0.0/24 10.0.0.0/32\n')
stub_stdouts(self)
with patch.object(sys, 'argv', ["prog.py", "-v"]):
agg_main()
self.assertEqual(sys.stdout.getvalue(), "+ 10.0.0.0/23\n- 10.0.0.0/24\n- 10.0.0.0/32\n- 10.0.1.0/24\n 172.16.0.0/24\n")


class StringIO(io.StringIO):
"""
Expand Down

0 comments on commit 3554065

Please sign in to comment.