forked from p15670423/monkey
Island: Add default value for Machine.operating_system_version
This commit is contained in:
parent
3e2244cd62
commit
5d51b40475
|
@ -26,7 +26,7 @@ class Machine(MutableInfectionMonkeyBaseModel):
|
||||||
operating_system: Optional[OperatingSystem]
|
operating_system: Optional[OperatingSystem]
|
||||||
"""The operating system the machine is running"""
|
"""The operating system the machine is running"""
|
||||||
|
|
||||||
operating_system_version: str
|
operating_system_version: str = Field(default="")
|
||||||
"""The specific version of the operating system the machine is running"""
|
"""The specific version of the operating system the machine is running"""
|
||||||
|
|
||||||
hostname: str
|
hostname: str
|
||||||
|
|
|
@ -180,6 +180,15 @@ def test_set_operating_system_version():
|
||||||
m.operating_system_version = "1234"
|
m.operating_system_version = "1234"
|
||||||
|
|
||||||
|
|
||||||
|
def test_operating_system_version_default_value():
|
||||||
|
missing_operating_system_version_dict = MACHINE_OBJECT_DICT.copy()
|
||||||
|
del missing_operating_system_version_dict["operating_system_version"]
|
||||||
|
|
||||||
|
m = Machine(**missing_operating_system_version_dict)
|
||||||
|
|
||||||
|
assert m.operating_system_version == ""
|
||||||
|
|
||||||
|
|
||||||
def test_set_hostname():
|
def test_set_hostname():
|
||||||
m = Machine(**MACHINE_OBJECT_DICT)
|
m = Machine(**MACHINE_OBJECT_DICT)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue