-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathModule.py
66 lines (42 loc) · 1.31 KB
/
Module.py
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
import os
"""Testing basic communication and keyword documentation using module.
Same stuff as in Basics.py but this library is implemented as a module,
not as a class.
"""
def passing():
"""This keyword passes.
See `Failing`, `Logging`, and `Returning` for other basic keywords.
"""
pass
def get_pid():
"""Return process id of the server that is serving this library."""
return os.getpid()
def failing(message):
"""This keyword fails with provided `message`"""
raise AssertionError(message)
def logging(message, level='INFO'):
"""This keywords logs given `message` with given `level`
Example:
| Logging | Hello, world! | |
| Logging | Warning!!! | WARN |
"""
print('*%s* %s' % (level, message))
def returning(value):
"""This keyword returns the given `value`."""
return value
def _private_method():
"""This is not a keyword. Nor is the next one."""
pass
def __private_method():
pass
ATTRIBUTE = 'Not a keyword'
if __name__ == '__main__':
import sys
from robotremoteserver import RobotRemoteServer
if sys.argv[-1] == 'no_stop':
conf = {'allow_remote_stop': False}
sys.argv.pop()
else:
conf = {}
library = sys.modules[__name__]
RobotRemoteServer(library, '127.0.0.1', *sys.argv[1:], **conf)