35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
import unittest
|
|
from src.xml_processor.xml_processor import XmlProcessor
|
|
|
|
|
|
class TestXmlCrawler(unittest.TestCase):
|
|
def test_something(self):
|
|
self.assertEqual(True, False) # add assertion here
|
|
|
|
def test_get_study_data(self):
|
|
self.assertEqual()
|
|
|
|
|
|
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
#def get_study_data(soup):
|
|
# study = soup.find('Study') # find 1 tag
|
|
# studyoid = study.get('OID')
|
|
# if studyoid == "some OID":
|
|
# odm = soup.find('ODM')
|
|
# studyoid_list = [odm.get('Description')]
|
|
# else:
|
|
# studyoid_list = [study.get('OID')]
|
|
# for child in study.GlobalVariables:
|
|
if child.name == 'StudyName':
|
|
studyname_list = [child.get_text()]
|
|
elif child.name == 'StudyDescription':
|
|
studydescr_list = [child.get_text()]
|
|
studydata = pd.DataFrame({"oid": studyoid_list,
|
|
"name": studyname_list,
|
|
"descr": studydescr_list})
|
|
return studydata
|
|
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|