-
Notifications
You must be signed in to change notification settings - Fork 4
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
14 changed files
with
148 additions
and
149 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
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
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,29 +1,27 @@ | ||
import unittest | ||
from pathlib import Path | ||
|
||
import slurminade | ||
|
||
test_file_path = Path("./f_test_file.txt") | ||
print("NOISE123") | ||
|
||
|
||
@slurminade.slurmify() | ||
def f(s): | ||
with open(test_file_path, "w") as file: | ||
with test_file_path.open("w") as file: | ||
file.write(s) | ||
|
||
|
||
class TestCreateCommand(unittest.TestCase): | ||
def test_dispatch_with_temp_file(self): | ||
slurminade.set_entry_point(__file__) | ||
if test_file_path.exists(): | ||
test_file_path.unlink() | ||
dispatcher = slurminade.SubprocessDispatcher() | ||
dispatcher.max_arg_length = 1 | ||
slurminade.set_dispatcher(dispatcher) | ||
s = "test" | ||
f.distribute(s) | ||
assert test_file_path.is_file() | ||
with open(test_file_path) as file: | ||
assert file.readline() == s | ||
if test_file_path.exists(): # delete the file | ||
test_file_path.unlink() | ||
def test_create_command_with_noise(): | ||
slurminade.set_entry_point(__file__) | ||
if test_file_path.exists(): | ||
test_file_path.unlink() | ||
dispatcher = slurminade.SubprocessDispatcher() | ||
dispatcher.max_arg_length = 1 | ||
slurminade.set_dispatcher(dispatcher) | ||
s = "test" | ||
f.distribute(s) | ||
assert test_file_path.is_file() | ||
with test_file_path.open() as file: | ||
assert file.readline() == s | ||
test_file_path.unlink(missing_ok=True) |
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
Oops, something went wrong.