-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added simple test for htcondor pool and job
- Loading branch information
1 parent
28f35e9
commit 442cb15
Showing
5 changed files
with
47 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Count TotalSlotCPUs TotalSlotDisk TotalSlotMemory | ||
2 2 224400.0 8000 | ||
2 2 223100.0 8000 | ||
1 8 196300.0 32200 | ||
1 4 29700.0 8000 |
Empty file.
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,24 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from lapis.pool_io.htcondor import htcondor_pool_reader | ||
|
||
|
||
def data_path(): | ||
return os.path.join(os.path.dirname(__file__), "..", "data", "htcondor_pools.csv") | ||
|
||
|
||
class TestHtcondorPoolReader(object): | ||
def test_init(self): | ||
with open(data_path()) as input_file: | ||
with pytest.raises(AssertionError): | ||
next(htcondor_pool_reader(input_file)) | ||
|
||
def test_simple(self): | ||
with open(data_path()) as input_file: | ||
pools = 0 | ||
for pool in htcondor_pool_reader(input_file, make_drone=lambda: None): | ||
assert pool is not None | ||
pools += 1 | ||
assert pools > 0 |
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,17 @@ | ||
import pytest | ||
|
||
from lapis.job import Job | ||
|
||
|
||
class TestJob(object): | ||
def test_init(self): | ||
with pytest.raises(AssertionError): | ||
Job({}, {}) | ||
assert Job({}, {"walltime": 100}) | ||
|
||
def test_name(self): | ||
name = "test" | ||
job = Job({}, {"walltime": 100}, name=name) | ||
assert job.name == name | ||
job = Job({}, {"walltime": 100}) | ||
assert job.name == id(job) |