def test_comment_parsing(self): """ Tests that comment gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.comment, "A Comment")
def test_source_index_parsing(self): """ Tests that source index gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.deleted_state, "Unknown")
def test_source_parsing(self): """ Tests that source entry gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.name, "3235326112452127.jpg")
def test_category_parsing(self): """ Tests that category gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.category, "Media Locations")
def test_timestamp_parsing(self): """ Tests that longitude gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.ts, "2020-12-16T11:53:14+01:00")
def test_lon_parsing(self): """ Tests that longitude gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.lon, float(12.21851))
def test_lat_parsing(self): """ Tests that latitude gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) ul = ufed_geo2csv.UfedLocation(xml_tree) self.assertEqual(ul.lat, float(52.3461117))
def test_matching_extra_info_parsing(self): """ Tests that extraInfo gets parsed correctly """ xml_tree = et.fromstring(TestUfedLocation.test_elem) extra_info_tree = et.fromstring(TestUfedLocation.extra_info_matching) ul = ufed_geo2csv.UfedLocation(xml_tree, extra_info_tree) self.assertEqual( ul.path, "NO NAME/DCIM/Camera/20180720_175843.jpg/20200720_175243.jpg_embedded_1_partial.jpg" ) self.assertEqual(ul.size, 1590096)