File: test_service.py

package info (click to toggle)
robotraconteur 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,380 kB
  • sloc: cpp: 1,149,268; cs: 87,653; java: 58,127; python: 26,897; ansic: 356; sh: 152; makefile: 90; xml: 51
file content (78 lines) | stat: -rw-r--r-- 2,231 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import pytest
from .ServiceTestClient import ServiceTestClient
import os
from RobotRaconteur.Client import *
import sys


def _member_test(fn, test_server_node_config):
    service_url = test_server_node_config.get_service_url(
        "RobotRaconteurTestService")
    c = ServiceTestClient()
    c.ConnectService(service_url)
    try:
        fn(c)
    finally:
        c.DisconnectService()


def test_properties(test_server_node_config):
    _member_test(lambda c: c.TestProperties(), test_server_node_config)


def test_functions(test_server_node_config):
    _member_test(lambda c: c.TestFunctions(), test_server_node_config)


def test_events(test_server_node_config):
    _member_test(lambda c: c.TestEvents(), test_server_node_config)


def test_objrefs(test_server_node_config):
    _member_test(lambda c: c.TestObjRefs(), test_server_node_config)


def test_pipes(test_server_node_config):
    _member_test(lambda c: c.TestPipes(), test_server_node_config)


def test_callbacks(test_server_node_config):
    _member_test(lambda c: c.TestCallbacks(), test_server_node_config)


def test_wires(test_server_node_config):
    _member_test(lambda c: c.TestWires(), test_server_node_config)


def test_memories(test_server_node_config):
    if sys.version_info < (3, 0):
        return
    _member_test(lambda c: c.TestMemories(), test_server_node_config)


def test_authentication(test_server_node_config):
    service_auth_url = test_server_node_config.get_service_url(
        "RobotRaconteurTestService_auth")
    c = ServiceTestClient()
    c.TestAuthentication(service_auth_url)


def test_object_lock(test_server_node_config):
    service_auth_url = test_server_node_config.get_service_url(
        "RobotRaconteurTestService_auth")
    c = ServiceTestClient()
    c.TestObjectLock(service_auth_url)


def test_monitor_lock(test_server_node_config):
    service_url = test_server_node_config.get_service_url(
        "RobotRaconteurTestService")
    c = ServiceTestClient()
    c.TestMonitorLock(service_url)


def test_async(test_server_node_config):
    service_auth_url = test_server_node_config.get_service_url(
        "RobotRaconteurTestService_auth")
    c = ServiceTestClient()
    c.TestAsync(service_auth_url)