Opened 6 years ago

Closed 6 years ago

#29920 closed Cleanup/optimization (fixed)

Add a test for smart_urlquote()'s UnicodeError branch

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: Testing framework Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is a block in utils.html.smart_urlquote() which There is no test coverage for except block:

    try:
        netloc = netloc.encode('idna').decode('ascii')  # IDN -> ACE
    except UnicodeError:  # invalid domain part
        return unquote_quote(url)

we need to propose an example to cover the except block.

Change History (6)

comment:1 by Hasan Ramezani, 6 years ago

Needs tests: set
Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:2 by Claude Paroz, 6 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Srinivas Reddy Thatiparthy, 6 years ago

comment:4 by Claude Paroz, 6 years ago

Has patch: set
Needs tests: unset

comment:5 by Tim Graham, 6 years ago

Summary: Test coverage for utils.html.smart_urlquoteAdd a test for smart_urlquote()'s UnicodeError branch
Triage Stage: AcceptedReady for checkin

For future reference, trivial patches to add additional test coverage don't require a ticket.

comment:6 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In a7ef4a56:

Fixed #29920 -- Added a test for smart_urlquote()'s UnicodeError branch.

Note: See TracTickets for help on using tickets.
Back to Top