示例#1
0
 def test_validate_two_options(self):
     data = MockPoll()
     data.options = [{'option_id': 0, 'description': 'Foo'},
                     {'option_id': 1, 'description': 'Bar'},
                    ]
     try:
         IPoll.validateInvariants(data)
     except InsuficientOptions:
         self.fail()
示例#2
0
 def test_validate_two_options(self):
     data = MockPoll()
     data.options = [
         {
             'option_id': 0,
             'description': 'Foo'
         },
         {
             'option_id': 1,
             'description': 'Bar'
         },
     ]
     try:
         IPoll.validateInvariants(data)
     except InsuficientOptions:
         self.fail()
示例#3
0
    def test_validate_one_option(self):
        data = MockPoll()
        data.options = [{'option_id': 0, 'description': 'Foo'}]

        with self.assertRaises(InsuficientOptions):
            IPoll.validateInvariants(data)
示例#4
0
    def test_validate_no_options(self):
        data = MockPoll()

        with self.assertRaises(InsuficientOptions):
            IPoll.validateInvariants(data)
示例#5
0
    def test_validate_one_option(self):
        data = MockPoll()
        data.options = [{'option_id': 0, 'description': 'Foo'}]

        with self.assertRaises(InsuficientOptions):
            IPoll.validateInvariants(data)
示例#6
0
    def test_validate_no_options(self):
        data = MockPoll()

        with self.assertRaises(InsuficientOptions):
            IPoll.validateInvariants(data)