File: test_ping.py

package info (click to toggle)
pysmartapp 0.3.5-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 340 kB
  • sloc: python: 1,342; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Tests for the ping module."""

from pysmartapp.const import LIFECYCLE_PING
from pysmartapp.ping import PingRequest

from .utilities import get_fixture


class TestPingRequest:
    """Tests for the PingRequest class."""

    @staticmethod
    def test_init():
        """Tests the init method."""
        # Arrange
        data = get_fixture('ping_request')
        # Act
        req = PingRequest(data)
        # Assert
        assert req.ping_data_raw == data['pingData']
        assert req.lifecycle == LIFECYCLE_PING
        assert req.execution_id == data['executionId']
        assert req.locale == data['locale']
        assert req.version == data['version']
        assert req.ping_challenge == '1a904d57-4fab-4b15-a11e-1c4bfe7cb502'