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)
Exemplo n.º 2
0
    def setUp(self):
        self.database = SerloDatabase("sqlite:///:memory:")
        self.person1, self.person2, self.person3 = generate_persons()[0:3]

        self.persons = [self.person1, self.person2, self.person3]

        self.project1, self.project2, \
                self.unit1, self.unit2 = generate_working_units()[0:4]

        self.units = [self.project1, self.project2, self.unit1, self.unit2]
    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))
Exemplo n.º 4
0
    def setUp(self):
        self.project1, self.project2, \
                self.unit1, self.unit2 = generate_working_units()

        self.person1, self.person2, self.person3 = generate_persons()