[issue18503] No assertion in test_del_param_on_nonexistent_header function

Vajrasky Kok report at bugs.python.org
Fri Jul 19 18:06:37 CEST 2013


Vajrasky Kok added the comment:

Anyway, I found another issue on line 393 on the same file:

    def test_del_nonexistent_param(self):
        msg = Message()
        msg.add_header('Content-Type', 'text/plain', charset='utf-8')
        existing_header = msg['Content-Type']
        msg.del_param('foobar', header='Content-Type')
        self.assertEqual(msg['Content-Type'], 'text/plain; charset="utf-8"')

The variable existing_header is never used. Either we can remove it or change it to:

    def test_del_nonexistent_param(self):
        msg = Message()
        msg.add_header('Content-Type', 'text/plain', charset='utf-8')
        existing_header = msg['Content-Type']
        msg.del_param('foobar', header='Content-Type')
        self.assertEqual(msg['Content-Type'], existing_header)

At first, I wanted to create a ticket for this. But then, I thought why do not we combine these menial problems together?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18503>
_______________________________________


More information about the Python-bugs-list mailing list