コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
    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)
コード例 #4
0
    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)
コード例 #5
0
    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)
コード例 #6
0
 def test_factory_bad_type(self):
     name = 'foo'
     with self.assertRaises(errors.UnknownQuestionTypeError):
         questions.question_factory('bad', name)
コード例 #7
0
 def test_factory_bad_type(self):
     name = "foo"
     with self.assertRaises(errors.UnknownQuestionTypeError):
         questions.question_factory("bad", name)
コード例 #8
0
 def test_factory_bad_type(self):
     name = 'foo'
     with self.assertRaises(errors.UnknownQuestionTypeError):
         questions.question_factory('bad', name)