-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement two specific ServerTech methods to change the outlets status (on, off, reboot) and to restart the PDU.
- Loading branch information
Showing
10 changed files
with
145 additions
and
8 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
Empty file.
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,26 @@ | ||
"""Tests for getters.""" | ||
|
||
import pytest | ||
from requests import HTTPError | ||
|
||
|
||
@pytest.mark.usefixtures("set_device_parameters") | ||
class TestAdd(object): | ||
"""Test additional methods.""" | ||
|
||
def test_set_outlet(self): | ||
res = self.device.set_outlet("AA01", "on") | ||
assert res["status"] == "success" | ||
|
||
with pytest.raises(ValueError): | ||
self.device.set_outlet("AA01", "no") | ||
|
||
with pytest.raises(HTTPError): | ||
self.device.set_outlet("XX99", "on") | ||
|
||
def test_reboot(self): | ||
res = self.device.restart("normal") | ||
assert res["status"] == "success" | ||
|
||
with pytest.raises(ValueError): | ||
self.device.restart("reboot") |
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