tborg.tests package

class tborg.tests.test_tborg.BaseTest(name, filename=None)[source]

Bases: TestCase

LOGGER_NAME = 'thunder-borg'
classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

class tborg.tests.test_tborg.TestClassMethods(name)[source]

Bases: BaseTest

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_config_with_auto_set_address()[source]

Test that auto_set_addr if set to True causes the API to find the first valid board and configure itself to that board.

test_find_board()[source]

Test that the ThunderBorg.find_board() method finds a board.

test_set_i2c_address_with_address_range_invalid()[source]

Test that an exception is raised when the address is out of range.

test_set_i2c_address_with_current_address()[source]

Test that the ThunderBorg.set_i2c_address() can set a different address. The current address is provided.

test_set_i2c_address_without_current_address()[source]

Test that the ThunderBorg.set_i2c_address() can set a different address. Scans address range to find current address.

class tborg.tests.test_tborg.TestNoSetUp(name)[source]

Bases: BaseTest

test_config_with_invalid_address()[source]

Test that an invalid address creates the expected exception.

test_config_with_invalid_board_id()[source]

Test that an invalid board ID causes the expected exception.

test_find_address_with_invalid_default_address()[source]

Test that an invalid default address will cause a board to be initialized if the auto_set_addr argument is True.

class tborg.tests.test_tborg.TestThunderBorg(name)[source]

Bases: BaseTest

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_get_battery_voltage()[source]

Test that the battery voltage is in range.

test_get_drive_fault_one()[source]

Test that get_drive_fault_one returns data.

test_get_drive_fault_two()[source]

Test that get_drive_fault_two returns data.

test_halt_motors()[source]

Test that halting the motors works properly.

test_set_and_get_comms_failsafe()[source]

Test that the failsafe changes states.

test_set_and_get_led_battery_state()[source]

Test that the LED state changes.

test_set_and_get_motor_one()[source]

Test that motor one responds to commands.

test_set_and_get_motor_two()[source]

Test that motor two responds to commands.

test_set_both_leds()[source]

Test that the RBG colors set are the same as the one’s returned.

test_set_both_motors()[source]

Test that motors one and two responds to commands.

test_set_external_led_colors()[source]

Test that setting external LEDs works correctly. This test requires external LEDs.

test_set_get_battery_monitoring_limits()[source]

Test that setting and getting the battery monitoring limits functions properly.

Note

Set limits based on a fully charged LiIon battery pack. This could be anywhere between 15.4 and 16.8 volts maximum depending on the type of batteries used. The minimum should never be less than 3 volts per cell or in a four pack 12 volts.

test_set_get_led_one()[source]

Test that the RBG colors set are the same as the one’s returned.

test_set_get_led_two()[source]

Test that the RBG colors set are the same as the one’s returned.

test_write_external_led_word()[source]

Test that writing binary data with the write_external_led_word method sets the LED correctly.