N4S4 / synology-api

A Python wrapper around Synology API
MIT License
360 stars 137 forks source link

Tests filestation api issue 159 #164

Closed fabtesta closed 5 months ago

fabtesta commented 5 months ago

Hi @N4S4,

to cover the login issues related to #159, I wrote a test class with a config file that could help to cover also the OTP use-case.

config-tests.json examples

## no otp
{
  "synology_ip": "192.168.1.xyz",
  "synology_port": "5001",
  "synology_user": "user_without_otp",
  "synology_password": "password",
  "synology_secure": true,
  "dsm_version": 7,
  "otp_code": null
}

## otp
{
  "synology_ip": "192.168.1.xyz",
  "synology_port": "5001",
  "synology_user": "user_with_otp",
  "synology_password": "password",
  "synology_secure": true,
  "dsm_version": 7,
  "otp_code": "123456"
}

from tests folder

python -m unittest test_syno_api.py

N4S4 commented 5 months ago

cool! thank you!