Skip to content

Allow extra arguments for CookieInformation#1310

Merged
aaltat merged 7 commits into
robotframework:masterfrom
aaltat:cookie_object_fix
Feb 16, 2019
Merged

Allow extra arguments for CookieInformation#1310
aaltat merged 7 commits into
robotframework:masterfrom
aaltat:cookie_object_fix

Conversation

@aaltat
Copy link
Copy Markdown
Contributor

@aaltat aaltat commented Feb 14, 2019

Fixes #1307

@aaltat
Copy link
Copy Markdown
Contributor Author

aaltat commented Feb 14, 2019

Not good enough, order of keys will be random and causes inconsistency.

@pekkaklarck
Copy link
Copy Markdown
Member

I'd just use

 self.extra = extra

instead of adding separate attributes for all this non-standard info. Not sure should it even be listed in __str__ either. Main problem at the moment is that this extra stuff breaks getting cookies. Nobody has told validating or even seeing this info is important.

@aaltat
Copy link
Copy Markdown
Contributor Author

aaltat commented Feb 15, 2019

Good point and it sounds like a better idea. At least it's easier to and needs some extra documentation.

@aaltat aaltat closed this Feb 15, 2019
@aaltat
Copy link
Copy Markdown
Contributor Author

aaltat commented Feb 15, 2019

Didn't mean to close the PR.

@aaltat aaltat reopened this Feb 15, 2019
Comment thread src/SeleniumLibrary/keywords/cookie.py Outdated
self.httpOnly = httpOnly
self.expiry = datetime.fromtimestamp(expiry) if expiry else None
if extra:
self.extra = extra
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditionally setting or not setting attribute is a bit of an anti-pattern. Is there some benefit here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true. Although I did explain it in the docs. Will change.

@aaltat aaltat merged commit 2264ac1 into robotframework:master Feb 16, 2019
@aaltat aaltat deleted the cookie_object_fix branch February 16, 2019 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants