|
|
@@ -1,209 +0,0 @@
|
|
|
-from sandbox import relationship
|
|
|
-
|
|
|
-relations_first_grade_female = [
|
|
|
- (("1.2.3.4.5", "1.2.3.4", "w"), "Mutter"),
|
|
|
- (("1.2.3.4.5", "1.2.3", "w"), "Großmutter"),
|
|
|
- (("1.2.3.4.5", "1.2", "w"), "Ur-Großmutter"),
|
|
|
- (("1.2.3.4.5", "1", "w"), "Ur-Ur-Großmutter"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6", "w"), "Tochter"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7", "w"), "Enkelin"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7.8", "w"), "Ur-Enkelin"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7.8.9", "w"), "Ur-Ur-Enkelin"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_second_grade_female = [
|
|
|
- (("1.2.3.4.5", "1.2.3.x", "w"), "Tante"),
|
|
|
- (("1.2.3.4.5", "1.2.x", "w"), "Großtante"),
|
|
|
- (("1.2.3.4.5", "1.x", "w"), "Ur-Großtante"),
|
|
|
- (("1.2.3.4.5", "x", "w"), "Ur-Ur-Großtante"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x", "w"), "Schwester"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6", "w"), "Nichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7", "w"), "Großnichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7.8", "w"), "Ur-Großnichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7.8.9", "w"), "Ur-Ur-Großnichte"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_higher_grade_female = [
|
|
|
- (("1.2.3.4.5", "1.2.3.x", "w"), "Tante"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x", "w"), "Tante 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x", "w"), "Tante 3. Grades"),
|
|
|
- (("1.2.3.4.5", "x.x.x.x", "w"), "Tante 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x", "w"), "Großtante"),
|
|
|
- (("1.2.3.4.5", "1.x.x", "w"), "Großtante 2. Grades"),
|
|
|
- (("1.2.3.4.5", "x.x.x", "w"), "Großtante 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x", "w"), "Ur-Großtante"),
|
|
|
- (("1.2.3.4.5", "x.x", "w"), "Ur-Großtante 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x", "w"), "Nichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x", "w"), "Nichte 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x", "w"), "Nichte 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x", "w"), "Nichte 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x", "w"), "Großnichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x", "w"), "Großnichte 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x", "w"), "Großnichte 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x", "w"), "Großnichte 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x", "w"), "Ur-Großnichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x", "w"), "Ur-Großnichte 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x.x", "w"), "Ur-Großnichte 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x.x", "w"), "Ur-Großnichte 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x.x", "w"), "Ur-Ur-Großnichte"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x.x", "w"), "Ur-Ur-Großnichte 2. Grades"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_special_grade_female = [
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x", "w"), "Schwester"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x", "w"), "Cousine"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x", "w"), "Cousine 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x", "w"), "Cousine 3. Grades"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_first_grade_male = [
|
|
|
- (("1.2.3.4.5", "1.2.3.4", "m"), "Vater"),
|
|
|
- (("1.2.3.4.5", "1.2.3", "m"), "Großvater"),
|
|
|
- (("1.2.3.4.5", "1.2", "m"), "Ur-Großvater"),
|
|
|
- (("1.2.3.4.5", "1", "m"), "Ur-Ur-Großvater"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6", "m"), "Sohn"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7", "m"), "Enkel"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7.8", "m"), "Ur-Enkel"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7.8.9", "m"), "Ur-Ur-Enkel"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_second_grade_male = [
|
|
|
- (("1.2.3.4.5", "1.2.3.x", "m"), "Onkel"),
|
|
|
- (("1.2.3.4.5", "1.2.x", "m"), "Großonkel"),
|
|
|
- (("1.2.3.4.5", "1.x", "m"), "Ur-Großonkel"),
|
|
|
- (("1.2.3.4.5", "x", "m"), "Ur-Ur-Großonkel"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x", "m"), "Bruder"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6", "m"), "Neffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7", "m"), "Großneffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7.8", "m"), "Ur-Großneffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.6.7.8.9", "m"), "Ur-Ur-Großneffe"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_higher_grade_male = [
|
|
|
- (("1.2.3.4.5", "1.2.3.x", "m"), "Onkel"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x", "m"), "Onkel 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x", "m"), "Onkel 3. Grades"),
|
|
|
- (("1.2.3.4.5", "x.x.x.x", "m"), "Onkel 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x", "m"), "Großonkel"),
|
|
|
- (("1.2.3.4.5", "1.x.x", "m"), "Großonkel 2. Grades"),
|
|
|
- (("1.2.3.4.5", "x.x.x", "m"), "Großonkel 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x", "m"), "Ur-Großonkel"),
|
|
|
- (("1.2.3.4.5", "x.x", "m"), "Ur-Großonkel 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x", "m"), "Neffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x", "m"), "Neffe 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x", "m"), "Neffe 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x", "m"), "Neffe 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x", "m"), "Großneffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x", "m"), "Großneffe 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x", "m"), "Großneffe 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x", "m"), "Großneffe 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x", "m"), "Ur-Großneffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x", "m"), "Ur-Großneffe 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x.x", "m"), "Ur-Großneffe 3. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x.x", "m"), "Ur-Großneffe 4. Grades"),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x.x", "m"), "Ur-Ur-Großneffe"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x.x", "m"), "Ur-Ur-Großneffe 2. Grades"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_special_grade_male = [
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x", "m"), "Bruder"),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x", "m"), "Cousin"),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x", "m"), "Cousin 2. Grades"),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x", "m"), "Cousin 3. Grades"),
|
|
|
-]
|
|
|
-
|
|
|
-relations_higher_grade_distance = [
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6", "w"), "Tochter", 1),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.5.6.7", "w"), "Enkelin", 2),
|
|
|
- (("1.2.3.4.5", "1", "w"), "Ur-Ur-Großmutter", 4),
|
|
|
- (("1.2.3.4.5", "1.2.3.x", "w"), "Tante", 3),
|
|
|
- (("1.2.3.4.5", "1.2.x.x", "w"), "Tante 2. Grades", 5),
|
|
|
- (("1.2.3.4.5", "1.x.x.x", "w"), "Tante 3. Grades", 7),
|
|
|
- (("1.2.3.4.5", "x.x.x.x", "w"), "Tante 4. Grades", 9),
|
|
|
- (("1.2.3.4.5", "1.2.x", "w"), "Großtante", 4),
|
|
|
- (("1.2.3.4.5", "1.x.x", "w"), "Großtante 2. Grades", 6),
|
|
|
- (("1.2.3.4.5", "x.x.x", "w"), "Großtante 3. Grades", 8),
|
|
|
- (("1.2.3.4.5", "1.x", "w"), "Ur-Großtante", 5),
|
|
|
- (("1.2.3.4.5", "x.x", "w"), "Ur-Großtante 2. Grades", 7),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x", "w"), "Nichte", 3),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x", "w"), "Nichte 2. Grades", 5),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x", "w"), "Nichte 3. Grades", 7),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x", "w"), "Nichte 4. Grades", 9),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x", "w"), "Großnichte", 4),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x", "w"), "Großnichte 2. Grades", 6),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x", "w"), "Großnichte 3. Grades", 8),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x", "w"), "Großnichte 4. Grades", 10),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x", "w"), "Ur-Großnichte", 5),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x", "w"), "Ur-Großnichte 2. Grades", 7),
|
|
|
- (("1.2.3.4.5", "1.2.x.x.x.x.x.x", "w"), "Ur-Großnichte 3. Grades", 9),
|
|
|
- (("1.2.3.4.5", "1.x.x.x.x.x.x.x", "w"), "Ur-Großnichte 4. Grades", 11),
|
|
|
- (("1.2.3.4.5", "1.2.3.4.x.x.x.x.x", "w"), "Ur-Ur-Großnichte", 6),
|
|
|
- (("1.2.3.4.5", "1.2.3.x.x.x.x.x.x", "w"), "Ur-Ur-Großnichte 2. Grades", 8),
|
|
|
-]
|
|
|
-
|
|
|
-burghard = [
|
|
|
- ("Harald", "1.4.6.3.4", "m"),
|
|
|
- ("Alice", "1.4.6.3.4.1", "w"),
|
|
|
- ("Janina", "1.4.6.3.4.2", "w"),
|
|
|
- ("Theresa", "1.4.6.3.4.2.1", "w"),
|
|
|
- ("Valentin", "1.4.6.3.4.2.2", "m"),
|
|
|
- ("Freya", "1.4.6.3.4.3", "w"),
|
|
|
-]
|
|
|
-
|
|
|
-burghard_freya = [("Freya", "1.4.6.3.4.3", "w", "Tochter", "Harald", "1.4.6.3.4", "m", "Vater", 1)]
|
|
|
-
|
|
|
-burghard_all = [("Harald", "1.4.6.3.4", "m", "ich", "Harald", "1.4.6.3.4", "m", "ich", 0)]
|
|
|
-
|
|
|
-
|
|
|
-def relations(relations_list):
|
|
|
- for rel, title in relations_list:
|
|
|
- result = relationship.relationship_name(*rel)
|
|
|
- assert result == title
|
|
|
-
|
|
|
-
|
|
|
-def test_first_grade_female():
|
|
|
- relations(relations_first_grade_female)
|
|
|
-
|
|
|
-
|
|
|
-def test_second_grade_female():
|
|
|
- relations(relations_second_grade_female)
|
|
|
-
|
|
|
-
|
|
|
-def test_higher_grade_female():
|
|
|
- relations(relations_higher_grade_female)
|
|
|
-
|
|
|
-
|
|
|
-def test_special_grade_female():
|
|
|
- relations(relations_special_grade_female)
|
|
|
-
|
|
|
-
|
|
|
-def test_first_grade_male():
|
|
|
- relations(relations_first_grade_male)
|
|
|
-
|
|
|
-
|
|
|
-def test_second_grade_male():
|
|
|
- relations(relations_second_grade_male)
|
|
|
-
|
|
|
-
|
|
|
-def test_higher_grade_male():
|
|
|
- relations(relations_higher_grade_male)
|
|
|
-
|
|
|
-
|
|
|
-def test_special_grade_male():
|
|
|
- relations(relations_special_grade_male)
|
|
|
-
|
|
|
-
|
|
|
-def test_distance():
|
|
|
- for rel, title, distance in relations_higher_grade_distance:
|
|
|
- result = relationship.relationship_distance(rel[0], rel[1])
|
|
|
- assert result == distance, title
|
|
|
-
|
|
|
-
|
|
|
-def test_relations_list():
|
|
|
- result = relationship.relationship_list(burghard, 5)
|
|
|
- assert result[0] == burghard_freya[0]
|
|
|
-
|
|
|
-
|
|
|
-def test_relations_list_all():
|
|
|
- result = relationship.relationship_list_all(burghard)
|
|
|
- assert result[0] == burghard_all[0]
|