File: __init__.py

package info (click to toggle)
python-stem 1.2.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,568 kB
  • ctags: 2,036
  • sloc: python: 20,108; makefile: 127; sh: 3
file content (39 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (8)
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
"""
Unit tests for the stem's interpreter prompt.
"""

__all__ = [
  'arguments',
  'autocomplete',
  'commands',
  'help',
]

try:
  # added in python 3.3
  from unittest.mock import Mock
except ImportError:
  from mock import Mock

GETINFO_NAMES = """
info/names -- List of GETINFO options, types, and documentation.
ip-to-country/* -- Perform a GEOIP lookup
md/id/* -- Microdescriptors by ID
""".strip()

GETCONF_NAMES = """
ExitNodes RouterList
ExitPolicy LineList
ExitPolicyRejectPrivate Boolean
""".strip()


CONTROLLER = Mock()

CONTROLLER.get_info.side_effect = lambda arg, _: {
  'info/names': GETINFO_NAMES,
  'config/names': GETCONF_NAMES,
  'events/names': 'BW DEBUG INFO NOTICE',
  'features/names': 'VERBOSE_NAMES EXTENDED_EVENTS',
  'signal/names': 'RELOAD HUP SHUTDOWN',
}[arg]