-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added gen_html_with_total_len to generating html taking in account ta… #82
Conversation
1 similar comment
@omaciel do you want to keep python 2.6 support here? |
@rochacbruno Good question. I took a look on travis and the reason it's is failing on 2.6 is OderedDict use. So it's not related to this change |
@rochacbruno @renzon the only reason I kept python 2.6 was because of @jlaska since he was using it for Ansible. @jlaska is this still the case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK pending comments
|
||
""" | ||
if length < 8: | ||
raise ValueError(u'Impossible generate html with len less then 7') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Impossible to generate HTML with len less than 7 characters"?
|
||
random.seed() | ||
html_tag = random.choice(HTML_TAGS) | ||
maybe_len = length - (len(html_tag) * 2 + 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment on the logic behind the calculation?
I don't believe we have any requirements for running |
If so, the way to go is adding the dependency https://pypi.python.org/pypi/ordereddict and make it conditional to Py2.6 |
@rochacbruno I'm all in favor of dropping py2.6 now then :) |
@renzon Lets drop 2.6? push in your branch removing the 2.6 from tox.ini and .travia files. |
@@ -543,11 +551,13 @@ def gen_ipaddr(ip3=False, ipv6=False, prefix=()): | |||
:param bool ip3: Whether to generate a 3 or 4 group IP. | |||
:param bool ipv6: Whether to generate IPv6 or IPv4 | |||
:param list prefix: A prefix to be used for an IP (e.g. [10, 0, 1]). It | |||
must be an iterable with strings or integers. Can be left unspecified or | |||
must be an iterable with strings or integers. Can be left | |||
unspecified or | |||
empty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can move this line up?
|
||
""" | ||
if length < 8: | ||
raise ValueError(u'Impossible generate html with less than 7 chars') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impossible to generate :)
1 similar comment
@@ -2,7 +2,7 @@ | |||
minversion = 2.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 2.7
2 similar comments
random.randint(0, 255) for _ in range(5) | ||
]) | ||
random.randint(0, 255) for _ in range(5) | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the indentation ok here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes Pycharm reformatting sucks. But at least I put the code in one line only and without using list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
* Implemented positive ui.test_myaccount.py tests close #3862 * Changed from gen_str to gen_alpha on ui.test_myaccount.py close #3862 * Refactored constants.LANGUAGES to a dictionary * Reverting datafactory, html function moved to fauxfactory omaciel/fauxfactory#82 * Moved my_account instance from MyAccountTestCase to UITestCase * Renamed MyAccountTestCase.user to account_user
…g chars