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()
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()
def test_validate_one_option(self): data = MockPoll() data.options = [{'option_id': 0, 'description': 'Foo'}] with self.assertRaises(InsuficientOptions): IPoll.validateInvariants(data)
def test_validate_no_options(self): data = MockPoll() with self.assertRaises(InsuficientOptions): IPoll.validateInvariants(data)