1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-23 18:50:29 +03:00

Unit test for out-of-range control

This commit is contained in:
Игорь Чудов 2020-03-06 18:43:23 +04:00
parent 32d7546a5a
commit 34344d66d8
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -43,6 +43,20 @@ class ControlTestCase(unittest.TestCase):
test_control = control(control_name, int(control_value))
test_control.set_control_status()
def test_control_int_out_of_range(self):
'''
Test procedure for control framework invocation with incorrect
integer value (out of range). The type of data loaded from PReg
must be 'int' but we're storing all values as strings inside the
database. So, for the test to be correct - we transform the
value to string first.
'''
control_name = 'sshd-gssapi-auth'
control_value = '50'
test_control = control(control_name, int(control_value))
test_control.set_control_status()
def test_control_with_str(self):
'''
Test procedure for control framework invocation with string