<s> """<STR_LIT>""" <EOL> import mock <EOL> from cerberusclient import client <EOL> from cerberusclient . tests import base <EOL> from cerberusclient . v1 import plugins <EOL> from cerberusclient . v1 import security_alarms <EOL> from cerberusclient . v1 import security_reports <EOL> from cerberusclient . v1 import tasks <EOL> def my_mock ( * a , ** b ) : <EOL> return [ a , b ] <EOL> def my_mock_plugin ( * a , ** b ) : <EOL> b [ '<STR_LIT>' ] = b <EOL> return [ a , b ] <EOL> def my_mock_task ( * a , ** b ) : <EOL> b [ '<STR_LIT>' ] = b <EOL> return [ a , b ] <EOL> def my_mock_security_report ( * a , ** b ) : <EOL> b [ '<STR_LIT>' ] = b <EOL> return [ a , b ] <EOL> def my_mock_security_alarm ( * a , ** b ) : <EOL> b [ '<STR_LIT>' ] = b <EOL> return [ a , b ] <EOL> api = mock . MagicMock ( json_request = my_mock ) <EOL> class TestCerberusclient ( base . TestCase ) : <EOL> def test_create_client_instance ( self ) : <EOL> endpoint = '<STR_LIT>' <EOL> test_client = client . Client ( '<STR_LIT:1>' , endpoint = endpoint , <EOL> token = '<STR_LIT:1>' , timeout = <NUM_LIT:10> ) <EOL> self . assertIsNotNone ( test_client . plugins ) <EOL> def test_plugin_manager_list ( self ) : <EOL> manager = plugins . PluginManager ( api ) <EOL> result = manager . list ( ) <EOL> self . assertEqual ( [ ] , result ) <EOL> def test_plugin_manager_get ( self ) : <EOL> api = mock . MagicMock ( json_request = my_mock_plugin ) <EOL> manager = plugins . PluginManager ( api ) <EOL> result = manager . get ( '<STR_LIT:test>' ) <EOL> self . assertIsNotNone ( result . manager ) <EOL> def test_task_manager_create ( self ) : <EOL> api = mock . MagicMock ( json_request = my_mock_task ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . create ( '<STR_LIT:test>' , '<STR_LIT>' ) <EOL> self . assertIsNotNone ( result . manager ) <EOL> def test_task_manager_list ( self ) : <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . list ( ) <EOL> self . assertEqual ( [ ] , result ) <EOL> def test_task_manager_get ( self ) : <EOL> api = mock . MagicMock ( json_request = my_mock_task ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . get ( '<STR_LIT:test>' ) <EOL> self . assertIsNotNone ( result . manager ) <EOL> def test_task_manager_stop ( self ) : <EOL> api = mock . MagicMock ( ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . stop ( <NUM_LIT:1> ) <EOL> self . assertIsNone ( result ) <EOL> def test_task_manager_delete ( self ) : <EOL> api = mock . MagicMock ( ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . delete ( <NUM_LIT:1> ) <EOL> self . assertIsNone ( result ) <EOL> def test_task_manager_force_delete ( self ) : <EOL> api = mock . MagicMock ( ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . force_delete ( <NUM_LIT:1> ) <EOL> self . assertIsNone ( result ) <EOL> def test_task_manager_restart ( self ) : <EOL> api = mock . MagicMock ( ) <EOL> manager = tasks . TaskManager ( api ) <EOL> result = manager . restart ( <NUM_LIT:1> ) <EOL> self . assertIsNone ( result ) <EOL> def test_security_reports_manager_list ( self ) : <EOL> manager = security_reports . SecurityReportManager ( api ) <EOL> result = manager . list ( ) <EOL> self . assertIsNotNone ( result ) <EOL> def test_security_reports_manager_get ( self ) : <EOL> api = mock . MagicMock ( json_request = my_mock_security_report ) <EOL> manager = security_reports . SecurityReportManager ( api ) <EOL> result = manager . get ( '<STR_LIT>' ) <EOL> self . assertIsNotNone ( result ) <EOL> def test_security_alarms_manager_list ( self ) : <EOL> manager = security_alarms . SecurityAlarmManager ( api ) <EOL> result = manager . list ( ) <EOL> self . assertIsNotNone ( result ) <EOL> def test_security_alarms_manager_get ( self ) : <EOL> api = mock . MagicMock ( json_request = my_mock_security_alarm ) <EOL> manager = security_alarms . SecurityAlarmManager ( api ) <EOL> result = manager . get ( '<STR_LIT>' ) <EOL> self . assertIsNotNone ( result ) </s>
