Example #1
0
 def test_build_individual_houses_map__second_families(self):
     result = build_individual_houses_map(10)
     self.assertEqual(result, {
         0: 0,
         1: 0,
         2: 1,
         3: 1,
         4: 1,
         5: 1,
         6: 1,
         7: 2,
         8: 2,
         9: 2
     })
Example #2
0
 def test_build_individual_houses_map__average_moroccan_household(self):
     result = build_individual_houses_map(1000)
     mean_family = np.mean([len(v) for k, v in invert_map(result).items()])
     self.assertTrue(abs(mean_family - 4.52) < 0.3)
Example #3
0
 def test_build_individual_houses_map__first_families(self):
     result = build_individual_houses_map(5)
     self.assertEqual(result, {0: 0, 1: 0, 2: 1, 3: 1, 4: 1})