コード例 #1
0
 def get_vscan_mock_object(self, type='zapi', kind=None, status=None):
     vscan_obj = vscan_module()
     if type == 'zapi':
         if kind is None:
             vscan_obj.server = MockONTAPConnection()
         else:
             vscan_obj.server = MockONTAPConnection(kind=kind, data=status)
     # For rest, mocking is achieved through side_effect
     return vscan_obj
コード例 #2
0
 def test_module_fail_when_required_args_missing(self):
     ''' required arguments are reported as errors '''
     with pytest.raises(AnsibleFailJson) as exc:
         set_module_args({})
         vscan_module()
     print('Info: %s' % exc.value.args[0]['msg'])