assertion style fixes
@@ -23,22 +23,22 @@ class TestServiceRecord:
@pytest.mark.parametrize("s_port", [None, 12, "34"])
def test_init(self, s_port):
obj = ServiceRecord("some id", "aName", "Storage", "http", "127.0.0.1", s_port, 1234)
- assert obj._id == "some id"
- assert obj._name == "aName"
- assert obj._type == "Storage"
+ assert "some id" == obj._id
+ assert "aName" == obj._name
+ assert "Storage" == obj._type
if s_port:
- assert obj._port == int(s_port)
+ assert int(s_port) == obj._port
else:
assert obj._port is None
- assert obj._management_port == 1234
- assert obj._status == 1
+ assert 1234 == obj._management_port
+ assert 1 == obj._status
@pytest.mark.parametrize("s_type", ["Storage", "Core", "Southbound"])
def test_init_with_valid_type(self, s_type):
obj = ServiceRecord("some id", "aName", s_type, "http", "127.0.0.1", None, 1234)
- assert obj._id == "some id"
- assert obj._name == "aName"
- assert obj._type == s_type
+ assert "some id" == obj._id
+ assert "aName" == obj._name
+ assert s_type == obj._type
def test_init_with_invalid_type(self):
with pytest.raises(Exception) as excinfo:
