-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anshengme
committed
Dec 11, 2017
1 parent
086feae
commit bee1d7c
Showing
8 changed files
with
43 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
twine==1.9.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import unittest | ||
|
||
|
||
class UtilsTest(unittest.TestCase): | ||
def test_random(self): | ||
pass | ||
from turbotools.utils import get_random_str | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
class UtilsTest(unittest.TestCase): | ||
def test_get_random_str(self): | ||
random_str = get_random_str(length=4, chars='0123456789') | ||
self.assertEqual(isinstance(int(random_str), int), True) | ||
self.assertEqual(len(random_str), 4) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__title__ = 'turbotools' | ||
__version__ = '0.0.1' | ||
__version__ = '0.0.3' | ||
__author__ = 'ansheng' | ||
__email__ = 'ianshengme@gmail.com' |
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,8 @@ | ||
import random | ||
import string | ||
|
||
|
||
def get_random_str(length=32, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase): | ||
"""在chars中生成length长度的字符串 | ||
""" | ||
return ''.join(random.SystemRandom().choice(chars) for _ in range(length)) |