Newer
Older
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#########################################################################################
# -*- coding: utf-8 -*-
#
# This file is part of the StationMaster project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
#########################################################################################
"""Contain the tests for the ."""
# Path
import sys
import os
path = os.path.join(os.path.dirname(__file__), os.pardir)
sys.path.insert(0, os.path.abspath(path))
# Imports
import pytest
from mock import MagicMock
from PyTango import DevState
# PROTECTED REGION ID(StationMaster.test_additional_imports) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_additional_imports
# Device test case
@pytest.mark.usefixtures("tango_context", "initialize_device")
# PROTECTED REGION ID(StationMaster.test_StationMaster_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_StationMaster_decorators
class TestStationMaster(object):
"""Test case for packet generation."""
properties = {
'SkaLevel': '4',
'LoggingLevelDefault': '4',
'LoggingTargetsDefault': '',
'GroupDefinitions': '',
'NrSubarrays': '16',
'CapabilityTypes': '',
'MaxCapabilities': '',
}
@classmethod
def mocking(cls):
"""Mock external libraries."""
# Example : Mock numpy
# cls.numpy = StationMaster.numpy = MagicMock()
# PROTECTED REGION ID(StationMaster.test_mocking) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_mocking
def test_properties(self, tango_context):
# Test the properties
# PROTECTED REGION ID(StationMaster.test_properties) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_properties
pass
# PROTECTED REGION ID(StationMaster.test_State_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_State_decorators
def test_State(self, tango_context):
"""Test for State"""
# PROTECTED REGION ID(StationMaster.test_State) ENABLED START #
assert tango_context.device.State() == DevState.UNKNOWN
# PROTECTED REGION END # // StationMaster.test_State
# PROTECTED REGION ID(StationMaster.test_Status_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_Status_decorators
def test_Status(self, tango_context):
"""Test for Status"""
# PROTECTED REGION ID(StationMaster.test_Status) ENABLED START #
assert tango_context.device.Status() == "The device is in UNKNOWN state."
# PROTECTED REGION END # // StationMaster.test_Status
# PROTECTED REGION ID(StationMaster.test_GetVersionInfo_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_GetVersionInfo_decorators
def test_GetVersionInfo(self, tango_context):
"""Test for GetVersionInfo"""
# PROTECTED REGION ID(StationMaster.test_GetVersionInfo) ENABLED START #
assert tango_context.device.GetVersionInfo() == [""]
# PROTECTED REGION END # // StationMaster.test_GetVersionInfo
# PROTECTED REGION ID(StationMaster.test_isCapabilityAchievable_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_isCapabilityAchievable_decorators
def test_isCapabilityAchievable(self, tango_context):
"""Test for isCapabilityAchievable"""
# PROTECTED REGION ID(StationMaster.test_isCapabilityAchievable) ENABLED START #
assert tango_context.device.isCapabilityAchievable([[0], [""]]) == False
# PROTECTED REGION END # // StationMaster.test_isCapabilityAchievable
# PROTECTED REGION ID(StationMaster.test_Reset_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_Reset_decorators
def test_Reset(self, tango_context):
"""Test for Reset"""
# PROTECTED REGION ID(StationMaster.test_Reset) ENABLED START #
assert tango_context.device.Reset() == [[0], [""]]
# PROTECTED REGION END # // StationMaster.test_Reset
# PROTECTED REGION ID(StationMaster.test_elementLoggerAddress_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_elementLoggerAddress_decorators
def test_elementLoggerAddress(self, tango_context):
"""Test for elementLoggerAddress"""
# PROTECTED REGION ID(StationMaster.test_elementLoggerAddress) ENABLED START #
assert tango_context.device.elementLoggerAddress == ''
# PROTECTED REGION END # // StationMaster.test_elementLoggerAddress
# PROTECTED REGION ID(StationMaster.test_elementAlarmAddress_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_elementAlarmAddress_decorators
def test_elementAlarmAddress(self, tango_context):
"""Test for elementAlarmAddress"""
# PROTECTED REGION ID(StationMaster.test_elementAlarmAddress) ENABLED START #
assert tango_context.device.elementAlarmAddress == ''
# PROTECTED REGION END # // StationMaster.test_elementAlarmAddress
# PROTECTED REGION ID(StationMaster.test_elementTelStateAddress_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_elementTelStateAddress_decorators
def test_elementTelStateAddress(self, tango_context):
"""Test for elementTelStateAddress"""
# PROTECTED REGION ID(StationMaster.test_elementTelStateAddress) ENABLED START #
assert tango_context.device.elementTelStateAddress == ''
# PROTECTED REGION END # // StationMaster.test_elementTelStateAddress
# PROTECTED REGION ID(StationMaster.test_elementDatabaseAddress_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_elementDatabaseAddress_decorators
def test_elementDatabaseAddress(self, tango_context):
"""Test for elementDatabaseAddress"""
# PROTECTED REGION ID(StationMaster.test_elementDatabaseAddress) ENABLED START #
assert tango_context.device.elementDatabaseAddress == ''
# PROTECTED REGION END # // StationMaster.test_elementDatabaseAddress
# PROTECTED REGION ID(StationMaster.test_buildState_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_buildState_decorators
def test_buildState(self, tango_context):
"""Test for buildState"""
# PROTECTED REGION ID(StationMaster.test_buildState) ENABLED START #
assert tango_context.device.buildState == ''
# PROTECTED REGION END # // StationMaster.test_buildState
# PROTECTED REGION ID(StationMaster.test_versionId_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_versionId_decorators
def test_versionId(self, tango_context):
"""Test for versionId"""
# PROTECTED REGION ID(StationMaster.test_versionId) ENABLED START #
assert tango_context.device.versionId == ''
# PROTECTED REGION END # // StationMaster.test_versionId
# PROTECTED REGION ID(StationMaster.test_loggingLevel_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_loggingLevel_decorators
def test_loggingLevel(self, tango_context):
"""Test for loggingLevel"""
# PROTECTED REGION ID(StationMaster.test_loggingLevel) ENABLED START #
assert tango_context.device.loggingLevel == 0
# PROTECTED REGION END # // StationMaster.test_loggingLevel
# PROTECTED REGION ID(StationMaster.test_healthState_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_healthState_decorators
def test_healthState(self, tango_context):
"""Test for healthState"""
# PROTECTED REGION ID(StationMaster.test_healthState) ENABLED START #
assert tango_context.device.healthState == 0
# PROTECTED REGION END # // StationMaster.test_healthState
# PROTECTED REGION ID(StationMaster.test_adminMode_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_adminMode_decorators
def test_adminMode(self, tango_context):
"""Test for adminMode"""
# PROTECTED REGION ID(StationMaster.test_adminMode) ENABLED START #
assert tango_context.device.adminMode == 0
# PROTECTED REGION END # // StationMaster.test_adminMode
# PROTECTED REGION ID(StationMaster.test_controlMode_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_controlMode_decorators
def test_controlMode(self, tango_context):
"""Test for controlMode"""
# PROTECTED REGION ID(StationMaster.test_controlMode) ENABLED START #
assert tango_context.device.controlMode == 0
# PROTECTED REGION END # // StationMaster.test_controlMode
# PROTECTED REGION ID(StationMaster.test_simulationMode_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_simulationMode_decorators
def test_simulationMode(self, tango_context):
"""Test for simulationMode"""
# PROTECTED REGION ID(StationMaster.test_simulationMode) ENABLED START #
assert tango_context.device.simulationMode == 0
# PROTECTED REGION END # // StationMaster.test_simulationMode
# PROTECTED REGION ID(StationMaster.test_testMode_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_testMode_decorators
def test_testMode(self, tango_context):
"""Test for testMode"""
# PROTECTED REGION ID(StationMaster.test_testMode) ENABLED START #
assert tango_context.device.testMode == 0
# PROTECTED REGION END # // StationMaster.test_testMode
# PROTECTED REGION ID(StationMaster.test_maxCapabilities_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_maxCapabilities_decorators
def test_maxCapabilities(self, tango_context):
"""Test for maxCapabilities"""
# PROTECTED REGION ID(StationMaster.test_maxCapabilities) ENABLED START #
assert tango_context.device.maxCapabilities == ('',)
# PROTECTED REGION END # // StationMaster.test_maxCapabilities
# PROTECTED REGION ID(StationMaster.test_availableCapabilities_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_availableCapabilities_decorators
def test_availableCapabilities(self, tango_context):
"""Test for availableCapabilities"""
# PROTECTED REGION ID(StationMaster.test_availableCapabilities) ENABLED START #
assert tango_context.device.availableCapabilities == ('',)
# PROTECTED REGION END # // StationMaster.test_availableCapabilities
# PROTECTED REGION ID(StationMaster.test_loggingTargets_decorators) ENABLED START #
# PROTECTED REGION END # // StationMaster.test_loggingTargets_decorators
def test_loggingTargets(self, tango_context):
"""Test for loggingTargets"""
# PROTECTED REGION ID(StationMaster.test_loggingTargets) ENABLED START #
assert tango_context.device.loggingTargets == ('',)
# PROTECTED REGION END # // StationMaster.test_loggingTargets