def test_factory_checkbox_type(self): name = 'foo' q = questions.question_factory('checkbox', name) self.assertEquals('checkbox', q.kind) self.assertIsInstance(q, questions.Checkbox) self.assertEquals(name, q.name)
def test_factory_list_type(self): name = 'foo' q = questions.question_factory('list', name) self.assertEquals('list', q.kind) self.assertIsInstance(q, questions.List) self.assertEquals(name, q.name)
def test_factory_password_type(self): name = 'foo' q = questions.question_factory('password', name) self.assertEquals('password', q.kind) self.assertIsInstance(q, questions.Password) self.assertEquals(name, q.name)
def test_factory_confirm_type(self): name = 'foo' q = questions.question_factory('confirm', name) self.assertEquals('confirm', q.kind) self.assertIsInstance(q, questions.Confirm) self.assertEquals(name, q.name)
def test_factory_text_type(self): name = 'foo' q = questions.question_factory('text', name) self.assertEqual('text', q.kind) self.assertIsInstance(q, questions.Text) self.assertEqual(name, q.name)
def test_factory_bad_type(self): name = 'foo' with self.assertRaises(errors.UnknownQuestionTypeError): questions.question_factory('bad', name)
def test_factory_bad_type(self): name = "foo" with self.assertRaises(errors.UnknownQuestionTypeError): questions.question_factory("bad", name)