tests: Add more tests to improve coverage, mostly testing exceptions.

This commit is contained in:
Damien George
2015-08-21 11:56:14 +01:00
parent d292a81e95
commit d007cb8903
19 changed files with 260 additions and 4 deletions

View File

@@ -86,3 +86,28 @@ try:
print("%(foo)*s" % {"foo": "bar"})
except TypeError:
print("TypeError")
try:
'%(a' % {'a':1}
except ValueError:
print('ValueError')
try:
'%.*d %.*d' % (20, 5)
except TypeError:
print('TypeError')
try:
a = '%*' % 1
except (ValueError):
print('ValueError')
try:
'%c' % 'aa'
except TypeError:
print('TypeError')
try:
'%l' % 1
except ValueError:
print('ValueError')