Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Index Str Assign AttributeStore NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Str Str Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num Num Num body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num body Assign NameStore Call NameLoad Num Num Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assert CompareEq NameLoad NameLoad Call AttributeLoad Str attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Index Str Assign AttributeStore NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Str Str Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Index Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assert CompareIs AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list decorator_list
N/A N/A Test cases for motor abstraction class. random randint unittest TestCase os path N/A bot.lib.lib lib N/A bot.hardware.motor m_mod tests.test_bot TestBot TestSpeed N/A TestBot N/A N/A Test setting and checking the speed of a motor. setUp N/A N/A self N/A N/A N/A Setup test hardware files and build motor object. N/A config N/A N/A N/A path dirname N/A N/A path realpath __file__ /test_config.yaml N/A N/A self config N/A N/A lib get_config config N/A N/A self pwm_num N/A N/A N/A N/A self config N/A two_motors N/A 0 N/A PWM N/A N/A self gpio_num N/A N/A N/A N/A self config N/A two_motors N/A 0 N/A GPIO N/A N/A N/A self setup_pwm N/A self pwm_num 1
 0
 1000
 0
 N/A N/A N/A self setup_gpio N/A self gpio_num N/A N/A self motor N/A N/A m_mod Motor N/A self pwm_num N/A self gpio_num N/A tearDown N/A N/A self N/A N/A N/A N/A test_off N/A N/A self N/A N/A N/A Test turning the motor off. N/A N/A N/A self motor speed 0 N/A N/A N/A N/A self motor speed 0 N/A test_full N/A N/A self N/A N/A N/A Test turning the motor to 100% duty cycle. N/A N/A N/A self motor speed 100 N/A N/A N/A N/A self motor speed 100 N/A test_half N/A N/A self N/A N/A N/A Test the motor at half speed. N/A N/A N/A self motor speed 50 N/A N/A N/A N/A self motor speed 50 N/A test_accel N/A N/A self N/A N/A N/A Test a series of increasing speeds. N/A speed N/A range 0 100 10 N/A N/A N/A N/A self motor speed speed N/A N/A N/A N/A self motor speed speed N/A test_manually_confirm N/A N/A self N/A N/A N/A Test a series of random speeds, read the simulated HW to confirm. N/A i N/A range 10 N/A N/A test_speed N/A randint 0 100 N/A N/A N/A self motor speed test_speed N/A cur_pwm N/A N/A self get_pwm N/A self pwm_num N/A duty N/A int N/A cur_pwm N/A duty_ns N/A period N/A int N/A cur_pwm N/A period_ns N/A speed N/A int N/A round N/A N/A duty N/A float period 100 N/A N/A speed test_speed N/A N/A {} != {} format speed test_speed N/A test_over_max N/A N/A self N/A N/A N/A Test speed over max speed. Should use maximum. N/A N/A N/A self motor speed 101 N/A N/A N/A N/A self motor speed 100 N/A test_under_min N/A N/A self N/A N/A N/A Test speed under minimum speed. Should use minimum. N/A N/A N/A self motor speed -1 N/A N/A N/A N/A self motor speed 0 N/A N/A TestDirection N/A TestBot N/A N/A Test setting and checking the direction of a motor. setUp N/A N/A self N/A N/A N/A Setup test hardware files and build motor object. N/A config N/A N/A N/A path dirname N/A N/A path realpath __file__ /test_config.yaml N/A N/A self config N/A N/A lib get_config config N/A N/A self pwm_num N/A N/A N/A N/A self config N/A two_motors N/A 0 N/A PWM N/A N/A self gpio_num N/A N/A N/A N/A self config N/A two_motors N/A 0 N/A GPIO N/A N/A N/A self setup_pwm N/A self pwm_num 1
 0
 1000
 0
 N/A N/A N/A self setup_gpio N/A self gpio_num N/A N/A self motor N/A N/A m_mod Motor N/A self pwm_num N/A self gpio_num N/A tearDown N/A N/A self N/A N/A N/A N/A test_forward N/A N/A self N/A N/A N/A Test motor in forward direction using text and int syntax. N/A N/A N/A self motor direction N/A m_mod FORWARD N/A N/A N/A N/A self motor direction forward N/A N/A N/A self motor direction forward N/A N/A N/A N/A self motor direction forward N/A test_reverse N/A N/A self N/A N/A N/A Test motor in reverse direction using text and int syntax. N/A N/A N/A self motor direction N/A m_mod REVERSE N/A N/A N/A N/A self motor direction reverse N/A N/A N/A self motor direction reverse N/A N/A N/A N/A self motor direction reverse N/A test_invalid N/A N/A self N/A N/A N/A Test a series of invalid directions. N/A N/A N/A self motor direction N/A m_mod FORWARD N/A N/A N/A self motor direction 2 N/A N/A N/A N/A self motor direction forward N/A N/A N/A self motor direction -1 N/A N/A N/A N/A self motor direction forward N/A N/A N/A self motor direction wrong N/A N/A N/A N/A self motor direction forward N/A N/A N/A self motor direction N/A N/A N/A N/A self motor direction forward N/A N/A TestNoDirection N/A TestCase N/A N/A Test a motor with no GPIO pin, and therefore no in-code direction. setUp N/A N/A self N/A N/A N/A Setup test hardware files and build motor object. N/A config N/A N/A N/A path dirname N/A N/A path realpath __file__ /test_config.yaml N/A N/A self config N/A N/A lib get_config config N/A N/A self pwm_num N/A N/A N/A N/A self config N/A two_motors N/A 0 N/A PWM N/A N/A self motor N/A N/A m_mod Motor N/A self pwm_num N/A test_set_dir N/A N/A self N/A N/A N/A Test setting a direction for a motor that should have no direction.

        As there should be no result from this call, we're just checking that
        no exception is raised.

         N/A N/A N/A self motor direction N/A m_mod FORWARD N/A N/A N/A self motor direction forward N/A N/A N/A self motor direction reverse N/A test_get_dir N/A N/A self N/A N/A N/A Get direction for a motor that should have no direction. N/A N/A N/A N/A self motor direction None N/A test_vol N/A N/A self N/A N/A N/A Get velocity for a motor that has no direction. N/A N/A N/A N/A self motor velocity N/A N/A self motor speed N/A N/A N/A self motor speed 50 N/A N/A N/A N/A self motor speed 50 N/A N/A N/A N/A self motor velocity 50 N/A N/A