mirror of
https://github.com/ProtoThis/python-synology.git
synced 2025-08-08 06:36:06 +00:00
Add DSM 5 SYNO.DSM.Network test (#45)
This commit is contained in:
@ -35,6 +35,7 @@ from .api_data.dsm_5 import (
|
||||
DSM_5_AUTH_LOGIN,
|
||||
DSM_5_AUTH_LOGIN_2SA,
|
||||
DSM_5_AUTH_LOGIN_2SA_OTP,
|
||||
DSM_5_DSM_NETWORK,
|
||||
DSM_5_DSM_INFORMATION,
|
||||
DSM_5_CORE_UTILIZATION,
|
||||
DSM_5_STORAGE_STORAGE_DS410J_RAID5_4DISKS_1VOL,
|
||||
@ -47,6 +48,7 @@ API_SWITCHER = {
|
||||
"AUTH_LOGIN_2SA": DSM_5_AUTH_LOGIN_2SA,
|
||||
"AUTH_LOGIN_2SA_OTP": DSM_5_AUTH_LOGIN_2SA_OTP,
|
||||
"DSM_INFORMATION": DSM_5_DSM_INFORMATION,
|
||||
"DSM_NETWORK": DSM_5_DSM_NETWORK,
|
||||
"CORE_UTILIZATION": DSM_5_CORE_UTILIZATION,
|
||||
"STORAGE_STORAGE": {"RAID": DSM_5_STORAGE_STORAGE_DS410J_RAID5_4DISKS_1VOL,},
|
||||
},
|
||||
|
@ -7,6 +7,7 @@ from .const_5_api_auth import (
|
||||
)
|
||||
from .core.const_5_core_utilization import DSM_5_CORE_UTILIZATION
|
||||
from .dsm.const_5_dsm_info import DSM_5_DSM_INFORMATION
|
||||
from .dsm.const_5_dsm_network import DSM_5_DSM_NETWORK
|
||||
from .storage.const_5_storage_storage import (
|
||||
DSM_5_STORAGE_STORAGE_DS410J_RAID5_4DISKS_1VOL,
|
||||
)
|
||||
|
20
tests/api_data/dsm_5/dsm/const_5_dsm_network.py
Normal file
20
tests/api_data/dsm_5/dsm/const_5_dsm_network.py
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""DSM 5 SYNO.DSM.Network data."""
|
||||
|
||||
DSM_5_DSM_NETWORK = {
|
||||
"data": {
|
||||
"dns": ["192.168.1.1"],
|
||||
"gateway": "192.168.1.1",
|
||||
"hostname": "HOME-NAS",
|
||||
"interfaces": [
|
||||
{
|
||||
"id": "eth0",
|
||||
"ip": [{"address": "192.168.1.10", "netmask": "255.255.255.0"}],
|
||||
"mac": "XX-XX-XX-XX-XX-XX",
|
||||
"type": "lan",
|
||||
}
|
||||
],
|
||||
"workgroup": "WORKGROUP",
|
||||
},
|
||||
"success": True,
|
||||
}
|
@ -210,6 +210,18 @@ class TestSynologyDSM(TestCase):
|
||||
assert self.api.information.version == "5967"
|
||||
assert self.api.information.version_string == "DSM 5.2-5967 Update 9"
|
||||
|
||||
def test_network(self):
|
||||
"""Test network."""
|
||||
assert self.api.network
|
||||
assert self.api.network.dns
|
||||
assert self.api.network.gateway
|
||||
assert self.api.network.hostname
|
||||
assert self.api.network.interfaces
|
||||
assert self.api.network.interface("eth0")
|
||||
assert self.api.network.interface("eth1") is None
|
||||
assert self.api.network.macs
|
||||
assert self.api.network.workgroup
|
||||
|
||||
def test_utilisation(self):
|
||||
"""Test utilization."""
|
||||
assert self.api.utilisation
|
||||
|
Reference in New Issue
Block a user