-
Notifications
You must be signed in to change notification settings - Fork 15
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 #128 from ttafsir/0.2.4-branch
0.2.4 branch
- Loading branch information
Showing
26 changed files
with
942 additions
and
990 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = "0.2.3" | ||
__version__ = "0.2.4" |
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.
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,22 @@ | ||
from datetime import datetime | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def setup_lab(lab, authenticated_client): | ||
lab_obj = authenticated_client.api.create_lab(**lab) | ||
yield lab_obj | ||
authenticated_client.api.delete_lab(lab["path"] + lab["name"]) | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def lab(): | ||
now = datetime.now() | ||
ts = str(datetime.timestamp(now)).split(".")[0] | ||
return {"name": f"test-lab-{ts}", "description": "Test Lab", "path": "/"} | ||
|
||
|
||
@pytest.fixture() | ||
def lab_path(lab): | ||
return lab["path"] + lab["name"] |
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,34 @@ | ||
class TestEvengApi: | ||
"""Test cases""" | ||
|
||
def test_api_get_server_status(self, authenticated_client): | ||
""" | ||
Verify server status using the API | ||
""" | ||
r = authenticated_client.api.get_server_status() | ||
assert r["data"].get("cpu") is not None | ||
|
||
def test_list_node_templates(self, authenticated_client): | ||
""" | ||
Verify we can list node templates from API | ||
""" | ||
r = authenticated_client.api.list_node_templates() | ||
assert r["data"] is not None | ||
|
||
def test_node_template_detail(self, authenticated_client): | ||
""" | ||
Verify that we get retrieve the details of a node template | ||
""" | ||
node_types = ["a10"] | ||
for n_type in node_types: | ||
detail = authenticated_client.api.node_template_detail(n_type) | ||
assert isinstance(detail, dict) | ||
|
||
def test_list_network_types(self, authenticated_client): | ||
""" | ||
Verify that we can retrieve EVE-NG networks. The | ||
data returned is a dictionary that includes | ||
network types and instances. | ||
""" | ||
r = authenticated_client.api.list_networks() | ||
assert r["data"]["bridge"] is not None |
Oops, something went wrong.