Module TwoPartyLegislature :: Class TwoPartyAgentTests
[hide private]
[frames] | no frames]

Class TwoPartyAgentTests

source code

       object --+    
                |    
unittest.TestCase --+
                    |
                   TwoPartyAgentTests

Nested Classes [hide private]

Inherited from unittest.TestCase: failureException

Instance Methods [hide private]
 
get_agent(self, ideology_input=None, tolerance_function=None)
Assemble a TwoPartyAgent with specified constructor arguments
source code
 
setUp(self)
Hook method for setting up the test fixture before exercising it.
source code
 
test_init_ideology_out_of_range(self)
ValueError should be raised when ideology is out of range
source code
 
test_init_ideology_sets_party(self)
Passing in an ideology should set the appropriate party affiliation
source code
 
test_init_tolerance_from_tolerancefunc_and_ideology(self)
A passed in tolerance function should be used to generate the tolerance level
source code
 
test_init_tolerance_from_ideology(self)
Ideology specified should result in specific tolerance
source code
 
test_get_party(self)
Party should equal zero due to party def override
source code
 
test_get_record(self)
Voting record should be a dictionary
source code
 
test_set_id(self)
set_id() should modify result of get_id()
source code
 
test_set_id_invalid_type(self)
set_id() should raise error if id is not int
source code
 
test_add_record_invalid_vote(self)
Invalid vote should raise an error
source code
 
test_add_record(self)
Added records should be returned by get record
source code
 
test_info_appropriate_party(self)
info() should display the appropriate party
source code
 
test_determine_party(self)
determine_party() should return appropriate party id based on ideology
source code

Inherited from unittest.TestCase: __call__, __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription, tearDown

Inherited from unittest.TestCase (private): _exc_info

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

Class Variables [hide private]
  agent = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setUp(self)

source code 
Hook method for setting up the test fixture before exercising it.
Overrides: unittest.TestCase.setUp
(inherited documentation)