generated from cvxgrp/simulator
-
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
Showing
6 changed files
with
33 additions
and
3 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
Empty file.
Binary file not shown.
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 @@ | ||
from cvx.cli.smallest_eigenvalue import smallest_ev | ||
|
||
|
||
def test_smallest_eigenvalue(resource_dir): | ||
file = resource_dir / "test.bson" | ||
|
||
smallest_ev(file) | ||
|
This file was deleted.
Oops, something went wrong.
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 pytest | ||
import mock | ||
|
||
from cvx.cli.weather import cli | ||
|
||
def test_weather(): | ||
temperature = cli(metric="temperature") | ||
print(temperature) | ||
assert isinstance(temperature, float) | ||
assert temperature > -50 | ||
assert temperature < 50 | ||
|
||
|
||
def test_missing_metric(): | ||
with pytest.raises(ValueError): | ||
cli(metric="maffay") | ||
|
||
|
||
def test_server_down(): | ||
with mock.patch("requests.get", return_value=mock.Mock(status_code=500)): | ||
with pytest.raises(ConnectionError): | ||
cli("temperature") | ||
|
||
|