-
Notifications
You must be signed in to change notification settings - Fork 171
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
Showing
9 changed files
with
236 additions
and
123 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
config.py | ||
*.cpp | ||
*.in | ||
*.out | ||
*.exe | ||
|
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,3 +1,3 @@ | ||
[MASTER] | ||
py-version=3.5 | ||
py-version=3.6 | ||
disable=R0902,R0903,R0913,R0917,R0912 |
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
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,44 @@ | ||
import subprocess | ||
import unittest | ||
import os | ||
import tempfile | ||
import shutil | ||
import sys | ||
|
||
|
||
class TestGeneral(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.original_directory = os.getcwd() | ||
self.temp_directory = tempfile.mkdtemp() | ||
os.chdir(self.temp_directory) | ||
|
||
def tearDown(self): | ||
os.chdir(self.original_directory) | ||
try: | ||
shutil.rmtree(self.temp_directory) | ||
except: | ||
pass | ||
|
||
def test_randseed_arg(self): | ||
with open("test_randseed.py", 'w', encoding='utf-8') as f: | ||
f.write("import cyaron as c\n" | ||
"c.process_args()\n" | ||
"for i in range(10):\n" | ||
" print(c.randint(1,1000000000),end=' ')\n") | ||
|
||
env = os.environ.copy() | ||
env['PYTHONPATH'] = self.original_directory + os.pathsep + env.get( | ||
'PYTHONPATH', '') | ||
result = subprocess.run([ | ||
sys.executable, 'test_randseed.py', | ||
'--randseed=pinkrabbit147154220' | ||
], | ||
env=env, | ||
stdout=subprocess.PIPE, | ||
universal_newlines=True, | ||
check=True) | ||
self.assertEqual( | ||
result.stdout, | ||
"243842479 490459912 810766286 646030451 191412261 929378523 273000814 982402032 436668773 957169453 " | ||
) |
Oops, something went wrong.