Ejemplo n.º 1
0
    def test_slice_fill_player_empty(self):
        with self.assertRaises(ValueError) as context:
            test_empty = owners.slice_fill_players(self.player_list_empty,
                                                   self.start, self.end)
            exception_message = """
				Two consecutive empty points in players timetable:
				{}, {}
				""".format(self.player_list_empty[4], self.player_list_empty[5])
Ejemplo n.º 2
0
    def test_slice_fill_players_first(self):
        with self.assertRaises(ValueError) as context:
            test_first = owners.slice_fill_players(self.player_list_first,
                                                   self.start, self.end)
            exception_message = """
				First position in players list is empty: {}
				""".format(self.player_list_first[0])
            self.assertTrue(exception_message in context.exception)
Ejemplo n.º 3
0
 def test_slice_fill_players_incomplete(self):
     test_i = owners.slice_fill_players(self.player_list_incomplete,
                                        self.start, self.end)
     mod_i = [list(pt) for pt in self.player_list_incomplete]
     mod_i = mod_i[2:-2]
     mod_i[1][1] = (mod_i[0][1] + mod_i[2][1]) / 2
     mod_i[5][1] = (mod_i[4][1] + mod_i[6][1]) / 2
     self.assertEqual(test_i, mod_i)
Ejemplo n.º 4
0
 def test_slice_fill_players_last(self):
     test_last = owners.slice_fill_players(self.player_list_last,
                                           self.start, self.end)
     mod_last = [list(pt) for pt in self.player_list_last][2:-2]
     mod_last[-1][1] = mod_last[-2][1]
     self.assertEqual(test_last, mod_last)
Ejemplo n.º 5
0
 def test_slice_fill_players_full(self):
     test_full = owners.slice_fill_players(self.player_list_full,
                                           self.start, self.end)
     mod_full = [list(pt) for pt in self.player_list_full][2:-2]
     self.assertEqual(test_full, mod_full)