Package qm :: Package test :: Package classes :: Module python :: Class ExceptionTest
[hide private]
[frames] | no frames]

Class ExceptionTest
source code

         object --+                
                  |                
extension.Extension --+            
                      |            
      runnable.Runnable --+        
                          |        
                  test.Test --+    
                              |    
              BaseExceptionTest --+
                                  |
                                 ExceptionTest

Check that the specified Python code raises an exception.

An 'ExceptionTest' checks that the specified Python code raises a particular exception. The test passes if the exception is an instance of the expected class and (optionally) if its value matches the expected value. If the code fails to raise an exception, the test fails.

Nested Classes [hide private]

Inherited from test.Test: OutcomeField, TestField

Inherited from runnable.Runnable: ResourceField

Inherited from extension.Extension: Type, __metaclass__


Instance Methods [hide private]
  MakeResult(self, exc_info, result)
Check the exception in 'exc_info' and construct the result.
  CheckArgument(self, exc_info, result)
Check that the exception argument matches expectations.

Inherited from BaseExceptionTest: Run

Inherited from test.Test: GetTargetGroup

Inherited from runnable.Runnable: GetAttachments, GetDatabase, GetId, __init__

Inherited from extension.Extension: GetClassName, GetExplicitArguments, MakeDomDocument, MakeDomElement, Write, __getattr__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
arguments  
_argument_dictionary  
_argument_list  
exception_class  

Inherited from BaseExceptionTest: exception_argument, source

Inherited from test.Test: PREREQUISITES_FIELD_ID, kind, prerequisites, target_group

Inherited from runnable.Runnable: EXTRA_DATABASE, EXTRA_ID, RESOURCE_FIELD_ID, resources

Inherited from object: __class__


Method Details [hide private]

MakeResult(self, exc_info, result)

source code 

Check the exception in 'exc_info' and construct the result.

'result' -- The result object for this test.
Overrides: BaseExceptionTest.MakeResult
(inherited documentation)

CheckArgument(self, exc_info, result)

source code 

Check that the exception argument matches expectations.

'result' -- The result object for this test.
Overrides: BaseExceptionTest.CheckArgument

Class Variable Details [hide private]

arguments

Value:
[<<class 'qm.fields.TextField'> exception_class>]                      
      

_argument_dictionary

Value:
{'exception_argument': <<class 'qm.fields.TextField'> exception_argume\
nt>,
 'exception_class': <<class 'qm.fields.TextField'> exception_class>,
 'prerequisites': <<class 'qm.fields.SetField'> prerequisites>,
 'resources': <<class 'qm.fields.SetField'> resources>,
 'source': <<class 'qm.fields.TextField'> source>,
 'target_group': <<class 'qm.test.test.TargetGroupField'> target_group\
>}                                                                     
      

_argument_list

Value:
[<<class 'qm.fields.TextField'> exception_class>,
 <<class 'qm.fields.SetField'> prerequisites>,
 <<class 'qm.test.test.TargetGroupField'> target_group>,
 <<class 'qm.fields.TextField'> source>,
 <<class 'qm.fields.TextField'> exception_argument>,
 <<class 'qm.fields.SetField'> resources>]                             
      

exception_class

Value:
'Exception'