forked from p15670423/monkey
Island: Remove `log_contents` from Agent model
This commit is contained in:
parent
ea94da9725
commit
d7be8e2bc0
|
@ -29,6 +29,3 @@ class Agent(MutableInfectionMonkeyBaseModel):
|
||||||
|
|
||||||
cc_server: Optional[SocketAddress]
|
cc_server: Optional[SocketAddress]
|
||||||
"""The address that the agent used to communicate with the island"""
|
"""The address that the agent used to communicate with the island"""
|
||||||
|
|
||||||
log_contents: str = Field(default="")
|
|
||||||
"""The contents of the agent's log (empty until the agent shuts down)"""
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ def test_constructor__defaults_from_simple_dict():
|
||||||
assert a.parent_id is None
|
assert a.parent_id is None
|
||||||
assert a.stop_time is None
|
assert a.stop_time is None
|
||||||
assert a.cc_server is None
|
assert a.cc_server is None
|
||||||
assert a.log_contents == ""
|
|
||||||
|
|
||||||
|
|
||||||
def test_to_dict():
|
def test_to_dict():
|
||||||
|
@ -46,7 +45,6 @@ def test_to_dict():
|
||||||
agent_simple_dict = AGENT_SIMPLE_DICT.copy()
|
agent_simple_dict = AGENT_SIMPLE_DICT.copy()
|
||||||
agent_simple_dict["stop_time"] = None
|
agent_simple_dict["stop_time"] = None
|
||||||
agent_simple_dict["cc_server"] = None
|
agent_simple_dict["cc_server"] = None
|
||||||
agent_simple_dict["log_contents"] = ""
|
|
||||||
|
|
||||||
assert a.dict(simplify=True) == agent_simple_dict
|
assert a.dict(simplify=True) == agent_simple_dict
|
||||||
|
|
||||||
|
@ -60,7 +58,6 @@ def test_to_dict():
|
||||||
("stop_time", []),
|
("stop_time", []),
|
||||||
("parent_id", 2.1),
|
("parent_id", 2.1),
|
||||||
("cc_server", [1]),
|
("cc_server", [1]),
|
||||||
("log_contents", None),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_construct_invalid_field__type_error(key, value):
|
def test_construct_invalid_field__type_error(key, value):
|
||||||
|
@ -128,10 +125,3 @@ def test_cc_server_set_validated():
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
a.cc_server = []
|
a.cc_server = []
|
||||||
|
|
||||||
|
|
||||||
def test_log_contents_set_validated():
|
|
||||||
a = Agent(**AGENT_SIMPLE_DICT)
|
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
|
||||||
a.log_contents = None
|
|
||||||
|
|
Loading…
Reference in New Issue