Resolves #369, add verbose output on --verbose flag
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
f2bf7f9e0d
commit
df7c2cc43f
9 changed files with 228 additions and 131 deletions
0
tests/unit/cli/__init__.py
Normal file
0
tests/unit/cli/__init__.py
Normal file
30
tests/unit/cli/verbose_proxy_test.py
Normal file
30
tests/unit/cli/verbose_proxy_test.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import
|
||||
from tests import unittest
|
||||
|
||||
from fig.cli import verbose_proxy
|
||||
|
||||
|
||||
class VerboseProxy(unittest.TestCase):
|
||||
|
||||
def test_format_call(self):
|
||||
expected = "(u'arg1', True, key=u'value')"
|
||||
actual = verbose_proxy.format_call(
|
||||
("arg1", True),
|
||||
{'key': 'value'})
|
||||
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_format_return_sequence(self):
|
||||
expected = "(list with 10 items)"
|
||||
actual = verbose_proxy.format_return(list(range(10)), 2)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_format_return(self):
|
||||
expected = "{u'Id': u'ok'}"
|
||||
actual = verbose_proxy.format_return({'Id': 'ok'}, 2)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_format_return_no_result(self):
|
||||
actual = verbose_proxy.format_return(None, 2)
|
||||
self.assertEqual(None, actual)
|
||||
Loading…
Add table
Add a link
Reference in a new issue