-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: removing the common parts out of the slow tests into a comm…
…on module
- Loading branch information
1 parent
6dd217b
commit 41cd9eb
Showing
3 changed files
with
44 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import git | ||
|
||
|
||
def shorten_sha(long_sha): | ||
return long_sha[:7] | ||
|
||
|
||
def git_current_head_sha(): | ||
repo = git.Repo(search_parent_directories=True) | ||
return repo.head.commit.hexsha | ||
|
||
|
||
def generate_data() -> list: | ||
text_with_emojis = "I love ⚽ very much 😁." | ||
text_with_a_number = '2833047 people live in this area. It is not a good area.' | ||
text_with_two_numbers = '2833047 and 1111 people live in this area.' | ||
text_with_punctuations = "This sentence doesn't seem to too many commas, periods or semi-colons (;)." | ||
text_with_a_date = "Todays date is 04/28/2020 for format mm/dd/yyyy, not 28/04/2020." | ||
text_with_dates = "Todays date is 28/04/2020 and tomorrow's date is 29/04/2020." | ||
text_with_duplicates = 'Everyone here is so hardworking. Hardworking people. ' \ | ||
'I think hardworking people are a good trait in our company.' | ||
data = [text_with_emojis, text_with_a_number, text_with_two_numbers, | ||
text_with_punctuations, text_with_a_date, text_with_dates, text_with_duplicates] | ||
|
||
new_data = [] | ||
for index in range(1): | ||
new_data.extend(data) | ||
return new_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters