diff options
Diffstat (limited to 'third_party/python/funcsigs/tests/test_formatannotation.py')
-rw-r--r-- | third_party/python/funcsigs/tests/test_formatannotation.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/python/funcsigs/tests/test_formatannotation.py b/third_party/python/funcsigs/tests/test_formatannotation.py new file mode 100644 index 0000000000..4b98e6037d --- /dev/null +++ b/third_party/python/funcsigs/tests/test_formatannotation.py @@ -0,0 +1,17 @@ +import funcsigs + +import unittest2 as unittest + +class TestFormatAnnotation(unittest.TestCase): + def test_string (self): + self.assertEqual(funcsigs.formatannotation("annotation"), + "'annotation'") + + def test_builtin_type (self): + self.assertEqual(funcsigs.formatannotation(int), + "int") + + def test_user_type (self): + class dummy (object): pass + self.assertEqual(funcsigs.formatannotation(dummy), + "tests.test_formatannotation.dummy") |