示例#1
0
文件: test_form.py 项目: z0r1nga/w3af
    def test_form_copy(self):
        form_params = FormParameters()
        form_params.add_input([("name", "username"), ("type", "text")])
        form_params.add_input([("name", "pwd"), ("type", "password")])

        form = Form(form_params)
        form.set_token(('username', 0))

        form_copy = copy.deepcopy(form)

        self.assertEqual(form.get_token(), form_copy.get_token())
        self.assertIsNot(None, form_copy.get_token())
示例#2
0
    def test_form_copy(self):
        form_params = FormParameters()
        form_params.add_field_by_attrs({'name': 'username', 'type': 'text'})
        form_params.add_field_by_attrs({'name': 'pwd', 'type': 'password'})

        form = Form(form_params)
        form.set_token(('username', 0))

        form_copy = copy.deepcopy(form)

        self.assertEqual(form.get_token(), form_copy.get_token())
        self.assertIsNot(None, form_copy.get_token())
示例#3
0
    def test_form_copy(self):
        form_params = FormParameters()
        form_params.add_field_by_attrs({'name': 'username', 'type': 'text'})
        form_params.add_field_by_attrs({'name': 'pwd', 'type': 'password'})

        form = Form(form_params)
        form.set_token(('username', 0))

        form_copy = copy.deepcopy(form)

        self.assertEqual(form.get_token(), form_copy.get_token())
        self.assertIsNot(None, form_copy.get_token())