def test_parse_working_units(self):
        """Testcase for the function `parse_working_units()`."""
        units = generate_working_units()
        spec = ET.fromstring(generate_working_unit_list_spec())
        persons = dict(parse_people(ET.fromstring(generate_people_specs()[0])))

        self.assertListEqual(parse_working_units(spec, persons), units)
    def test_parse_people(self):
        """Testcase for the function `parse_people()`."""
        specs = [ET.fromstring(x) for x in generate_people_specs()]
        people = generate_people()

        self.assertListEqual(parse_people(specs[0]), people[0])
        self.assertListEqual(parse_people(specs[1]), people[1])
        self.assertListEqual(parse_people(specs[2]), people[2])
    def test_parse_working_unit(self):
        """Testcase for the function `parse_working_unit()`."""
        specs = [ET.fromstring(x) for x in generate_working_unit_specs()]
        units = generate_working_units()
        persons = dict(parse_people(ET.fromstring(generate_people_specs()[0])))

        self.assertEqual(parse_working_unit(specs[0], persons), units[0])
        self.assertEqual(parse_working_unit(specs[1], persons), units[1])
        self.assertEqual(parse_working_unit(specs[2], persons), units[2])
        self.assertEqual(parse_working_unit(specs[3], persons), units[3])

        self.assertIsNone(parse_working_unit(
            ET.fromstring("""<deal>
                              <category-id type="integer">123</category-id>
                             </deal>"""), persons))