91ac1d956e
* Rework tests * Add account test * Add Find My iPhone devices test * Remove logger * Working with Python 3.4 * Make test working in more setups @patch("keyring.get_password", return_value=None) * Fix Python 2.7 ASCII * Pylint * Self reviewed
33 lines
1 KiB
Python
33 lines
1 KiB
Python
"""Account service tests."""
|
|
from unittest import TestCase
|
|
from . import PyiCloudServiceMock
|
|
from .const import AUTHENTICATED_USER, VALID_PASSWORD
|
|
|
|
|
|
class AccountServiceTest(TestCase):
|
|
""""Account service tests"""
|
|
|
|
service = None
|
|
|
|
def setUp(self):
|
|
self.service = PyiCloudServiceMock(AUTHENTICATED_USER, VALID_PASSWORD).account
|
|
|
|
def test_devices(self):
|
|
"""Tests devices."""
|
|
assert len(self.service.devices) == 2
|
|
|
|
for device in self.service.devices:
|
|
assert device.name
|
|
assert device.model
|
|
assert device.udid
|
|
assert device["serialNumber"]
|
|
assert device["osVersion"]
|
|
assert device["modelLargePhotoURL2x"]
|
|
assert device["modelLargePhotoURL1x"]
|
|
assert device["paymentMethods"]
|
|
assert device["name"]
|
|
assert device["model"]
|
|
assert device["udid"]
|
|
assert device["modelSmallPhotoURL2x"]
|
|
assert device["modelSmallPhotoURL1x"]
|
|
assert device["modelDisplayName"]
|