Skip to content

Commit 8d72241

Browse files
committed
Add smoke test for YAML loading
1 parent 036e288 commit 8d72241

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ boto3-stubs = {version = "^1.20", extras = ["ec2", "route53"]}
1818
[tool.poetry.dev-dependencies]
1919
pytest = "^6.2"
2020
pytest-mock = "^3.6"
21+
pyfakefs = "^4.5"
2122
black = {version = "^21.12b0", allow-prereleases = true}
2223
mypy = "^0.931"
2324
types_PyYAML = "^6.0"

tests/test_aws.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import boto3
2-
import pytest # type: ignore
2+
import pytest
33
from moto import mock_ec2 # type: ignore
44

55
from citc.aws import AwsNode, get_types_info

tests/test_google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import googleapiclient.discovery # type: ignore
2-
import pytest # type: ignore
2+
import pytest
33
from mebula import mock_google
44

55
from citc.google import GoogleNode, get_types_info

tests/test_oracle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import oci # type: ignore
2-
import pytest # type: ignore
2+
import pytest
33
from mebula import mock_oracle
44

55
from citc.oracle import OracleNode

tests/test_slurm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import subprocess
22
import textwrap
33

4-
import pytest # type: ignore
4+
import pytest
55

66
from citc.slurm import node_list, SlurmNode, parse_features
77

tests/test_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from citc.utils import get_cloud_nodes
2+
3+
import pytest
4+
5+
6+
def test_get_cloud_nodes_error(fs):
7+
fs.create_file("/etc/citc/startnode.yaml", contents="---\ncsp: blahblah")
8+
9+
with pytest.raises(Exception):
10+
get_cloud_nodes()

0 commit comments

Comments
 (0)