Esempio n. 1
0
    def testBorda(self):
        ranks = [[0, 1, 2]]
        self.assertListEqual(Rules.borda(ranks), [0, 1, 2])

        ranks = [[0, 1, 2], [2, 1, 0], [2, 1, 0]]
        self.assertListEqual(Rules.borda(ranks), [2, 1, 0])
Esempio n. 2
0
 def update(self, vote):
     self.ranks = Rules.borda(self.get_ranks())
     self.updated = datetime.now()
     self.number_of_votes += 1
     self.put()
Esempio n. 3
0
 def testBorda(self):
     ranks = [[0,1,2]]
     self.assertListEqual(Rules.borda(ranks), [0, 1, 2])
     
     ranks = [[0,1,2], [2,1,0], [2,1,0]]
     self.assertListEqual(Rules.borda(ranks), [2, 1, 0])
Esempio n. 4
0
 def update(self, vote):
     self.ranks = Rules.borda(self.get_ranks())
     self.updated = datetime.now()
     self.number_of_votes += 1
     self.put()