Module unittestzero :: Class Assert
[hide private]
[frames] | no frames]

Class Assert

source code

Class Methods [hide private]
 
equal(self, first, second, msg=None)
Asserts that 2 elements are the same
source code
 
not_equal(self, first, second, msg=None)
Asserts that 2 elements are the same
source code
 
true(self, first, msg=None)
Asserts that what is given is equal to True
source code
 
false(self, first, msg=None)
Asserts that what is given is equal to False
source code
 
none(self, first, msg=None)
Asserts that what is given is equal to None
source code
 
not_none(self, first, msg=None)
Asserts that what is given is not equal to None
source code
 
fail(self, msg)
Raises an assertion error with a message passed in
source code
 
is_sorted_ascending(self, iterable, msg='')
Goes through a list and asserts that items in the list are sorted ascendingly
source code
 
is_sorted_descending(self, iterable, msg='')
Goes through a list and asserts that items in the list are sorted descendingly
source code
 
raises(self, exception, caller, msg=None, *args, **kwargs)
Asserts that an Error is raised when calling a method
source code
 
contains(self, needle, haystack) source code
 
less(self, first, second, msg=None)
Asserts that first element is < the second element
source code
 
greater(self, first, second, msg=None)
Asserts that first element is greater than the second element
source code
 
less_equal(self, first, second, msg=None)
Asserts that the first element is <= to the second element
source code
 
greater_equal(self, first, second, msg=None)
Asserts that first element is >= to the send element
source code
Method Details [hide private]

equal(self, first, second, msg=None)
Class Method

source code 

Asserts that 2 elements are the same

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails

not_equal(self, first, second, msg=None)
Class Method

source code 

Asserts that 2 elements are the same

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails

true(self, first, msg=None)
Class Method

source code 

Asserts that what is given is equal to True

:Args:

  • First object to be tested
  • Message that will be printed if it fails

false(self, first, msg=None)
Class Method

source code 

Asserts that what is given is equal to False

:Args:

  • First object to be tested
  • Message that will be printed if it fails

none(self, first, msg=None)
Class Method

source code 

Asserts that what is given is equal to None

:Args:

  • First object to be tested
  • Message that will be printed if it fails

not_none(self, first, msg=None)
Class Method

source code 

Asserts that what is given is not equal to None

:Args:

  • First object to be tested
  • Message that will be printed if it fails

fail(self, msg)
Class Method

source code 

Raises an assertion error with a message passed in

:Args:

  • Message that will be printed

is_sorted_ascending(self, iterable, msg='')
Class Method

source code 

Goes through a list and asserts that items in the list are sorted ascendingly

:Args:

  • List that will be asserted against
  • Message that will be printed if it fails

is_sorted_descending(self, iterable, msg='')
Class Method

source code 

Goes through a list and asserts that items in the list are sorted descendingly

:Args:

  • List that will be asserted against
  • Message that will be printed if it fails

raises(self, exception, caller, msg=None, *args, **kwargs)
Class Method

source code 

Asserts that an Error is raised when calling a method

:Args:

  • Error class
  • method to be called
  • Message that will be printed if it fails
  • args that will be passed to the caller
  • kwargs that will be passed to the caller

less(self, first, second, msg=None)
Class Method

source code 

Asserts that first element is < the second element

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails

greater(self, first, second, msg=None)
Class Method

source code 

Asserts that first element is greater than the second element

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails

less_equal(self, first, second, msg=None)
Class Method

source code 

Asserts that the first element is <= to the second element

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails

greater_equal(self, first, second, msg=None)
Class Method

source code 

Asserts that first element is >= to the send element

:Args:

  • First object to be tested
  • Second object to be tested
  • Message that will be printed if it fails