Beispiel #1
0
 def testReportHelps(self):
     "helps gives us back a string"
     for name in electionRuleNames():
         Rule = electionRule(name)
         helps = dict()
         Rule.helps(helps, name)
         self.assertTrue(isinstance(helps[name], str), 'expected help string for %s' % name)
Beispiel #2
0
 def testMethod(self):
     "method is meek or wigm or qpq for each rule"
     for name in electionRuleNames():
         Rule = electionRule(name)
         method = Rule.method
         self.assertTrue(method in ('meek', 'wigm', 'qpq'),
                         'bad method "%s"' % method)
Beispiel #3
0
 def testReportHelps(self):
     "helps gives us back a string"
     for name in electionRuleNames():
         Rule = electionRule(name)
         helps = dict()
         Rule.helps(helps, name)
         self.assertTrue(isinstance(helps[name], str),
                         'expected help string for %s' % name)
Beispiel #4
0
 def testElectionRule(self):
     "look up one election rule"
     self.assertEqual(electionRule('qpq'), Rule, 'the qpq Rule should match its name lookup')
Beispiel #5
0
 def testElectionRule(self):
     "look up one election rule"
     self.assertEqual(electionRule('qpq'), Rule,
                      'the qpq Rule should match its name lookup')
Beispiel #6
0
 def testMplsWigm(self):
     "mpls is is a wigm variant"
     rule = electionRule('mpls')(None)
     self.assertEqual(rule.method, 'wigm')
Beispiel #7
0
 def testMethod(self):
     "method is meek or wigm or qpq for each rule"
     for name in electionRuleNames():
         Rule = electionRule(name)
         method = Rule.method
         self.assertTrue(method in ('meek', 'wigm', 'qpq'), 'bad method "%s"' % method)
Beispiel #8
0
 def testMplsWigm(self):
     "mpls is is a wigm variant"
     rule = electionRule('mpls')(None)
     self.assertEqual(rule.method, 'wigm')
Beispiel #9
0
 def testElectionRule(self):
     "look up one election rule"
     self.assertEqual(electionRule('scotland'), Rule,
                      'the scotland Rule should match its name lookup')
 def testElectionRule(self):
     "look up one election rule"
     self.assertEqual(electionRule('scotland'), Rule, 'the scotland Rule should match its name lookup')