Skip to content

Commit c56a8a7

Browse files
committed
Fix test to account for mixxing dicttoxml.
CI doesn't have dicttoxml installed. Make test pass with and without it installed.
1 parent c0d1560 commit c56a8a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/rest_common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,14 @@ def testDispatch(self):
15801580
form)
15811581
self.assertEqual(self.server.client.response_code, 406)
15821582
print(results)
1583+
try: # only verify local copy not system installed copy
1584+
from roundup.dicttoxml import dicttoxml
1585+
includexml = ', application/xml'
1586+
except ImportError:
1587+
includexml = ''
1588+
15831589
response="Requested content type 'jon' is not available.\n" \
1584-
"Acceptable types: */*, application/json, application/xml\n"
1590+
"Acceptable types: */*, application/json%s\n"%includexml
15851591
self.assertEqual(results, response)
15861592

15871593
# TEST #9

0 commit comments

Comments
 (0)