def test_with_password_raises_ValueError_when_there_is_no_username(self): url = URLObject('https://github.com/') assert_raises(ValueError, lambda: url.with_password('1234'))
def test_with_password_replaces_password(self): url = URLObject('https://*****:*****@github.com/') assert url.with_password('5678') == 'https://*****:*****@github.com/'
def test_with_password_adds_password(self): url = URLObject('https://[email protected]/') assert url.with_password('1234') == 'https://*****:*****@github.com/'