Skip to content

Commit

Permalink
fix the tests and cleanup dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinit Kumar committed Nov 13, 2017
1 parent b39fbec commit 1a7cf2e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
12 changes: 5 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Beautifulsoup4==4.4.1
dict2xml==1.3
json2xml==1.0.1
requests==2.9.1
simplejson==3.6.5
six==1.9.0
wheel==0.24.0
dict2xml==1.5
six==1.11.0
lxml==4.1.1
requests==2.18.4
xmltodict==0.11.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
include_package_data=True,
install_requires=[
'dict2xml==1.5',
'simplejson==3.10.0',
'six==1.11.0',
'lxml==4.1.1',
'requests==2.18.4',
'xmltodict==0.11.0'
],
)
10 changes: 8 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@


import unittest
from collections import OrderedDict

import xmltodict

from src.json2xml import Json2xml


Expand All @@ -15,8 +19,10 @@ def test_is_json_from_file_works(self):
data = Json2xml.fromjsonfile('examples/example.json').data
data_object = Json2xml(data)
xml_output = data_object.json2xml()
htmlkeys = xml_output.XML_FORMATTERS.keys()
self.assertTrue('html' in htmlkeys)
dict_from_xml = xmltodict.parse(xml_output)
# since it's a valid XML, xml to dict is able to load it and return
# elements from under the all tag of xml
self.assertTrue(type(dict_from_xml['all']) == OrderedDict)


if __name__ == '__main__':
Expand Down

0 comments on commit 1a7cf2e

Please sign in to comment.