-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from wfondrie/v1.0.0rc1
Release candidate for version 1.0.0
- Loading branch information
Showing
13 changed files
with
137 additions
and
5 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
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 @@ | ||
"""Test the configuration""" | ||
import os | ||
from pathlib import Path | ||
|
||
import pytest | ||
import ppx | ||
|
||
PXID = "PXD000001" | ||
|
||
|
||
def test_reset_dir(monkeypatch): | ||
"""Test resetting the data directory""" | ||
monkeypatch.delenv("PPX_DATA_DIR") | ||
ppx.set_data_dir() | ||
assert ppx.get_data_dir() == Path(Path.home(), ".ppx") | ||
|
||
ppx.PrideProject(PXID) | ||
assert Path(Path.home(), ".ppx").exists() | ||
|
||
|
||
def test_change_dir(monkeypatch, tmp_path): | ||
"""Test changing the data dir""" | ||
test_dir = tmp_path / "test" | ||
with pytest.raises(FileNotFoundError): | ||
ppx.set_data_dir(test_dir) | ||
|
||
test_dir.mkdir() | ||
ppx.set_data_dir(test_dir) | ||
assert ppx.get_data_dir() == test_dir | ||
|
||
proj = ppx.PrideProject(PXID) | ||
assert proj.local == test_dir / PXID | ||
|
||
test_dir = tmp_path / "test2" | ||
monkeypatch.setenv("PPX_DATA_DIR", str(test_dir)) | ||
with pytest.raises(FileNotFoundError): | ||
ppx.set_data_dir() | ||
|
||
test_dir.mkdir() | ||
ppx.set_data_dir(test_dir) | ||
assert ppx.get_data_dir() == test_dir | ||
|
||
proj = ppx.PrideProject(PXID) | ||
assert proj.local == test_dir / PXID |
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 @@ | ||
"""Test that the list_projects() functions work""" | ||
import pytest | ||
import ppx | ||
|
||
|
||
def test_pride(): | ||
"""Test that we can get pride projects""" | ||
proj = ppx.pride.list_projects() | ||
assert len(proj) > 10000 | ||
assert all((p.startswith("PXD") or p.startswith("PRD")) for p in proj) | ||
|
||
|
||
def test_massive(): | ||
"""Test that we can get massive projects""" | ||
proj = ppx.massive.list_projects() | ||
assert len(proj) > 10000 | ||
assert all((p.startswith("MSV") or p.startswith("RMS")) for p in proj) |
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