Adding the fix for the config ..
This commit is contained in:
1 parent
9b48b01d1d
commit
fac7b9a082
3 files changed
+23
-6
No files matched your search
@@ -57,8 +57,8 @@ def test_reject_name_too_long():
|
||||
|
||||
|
||||
def test_reject_bad_name_chars():
|
||||
with pytest.raises(Exception, match="alphanumeric"):
|
||||
UPSConfig(name="bad name!", host="192.168.1.10")
|
||||
with pytest.raises(Exception, match="letters, digits"):
|
||||
UPSConfig(name="bad/name!", host="192.168.1.10")
|
||||
|
||||
|
||||
def test_accept_valid_name_chars():
|
||||
@@ -66,6 +66,13 @@ def test_accept_valid_name_chars():
|
||||
assert u.name == "ups_rack-01"
|
||||
|
||||
|
||||
def test_accept_name_with_space_and_dot():
|
||||
u = UPSConfig(name="APC UPS", host="192.168.1.10")
|
||||
assert u.name == "APC UPS"
|
||||
u2 = UPSConfig(name="Server.Room.UPS", host="192.168.1.10")
|
||||
assert u2.name == "Server.Room.UPS"
|
||||
|
||||
|
||||
def test_reject_invalid_port():
|
||||
with pytest.raises(Exception):
|
||||
UPSConfig(name="x", host="192.168.1.10", port=0)
|
||||
|
||||
Reference in new issue
Block a user