Module Expr Str ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad With Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad Num Num body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad Num Num body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Dict Num Num Num Num Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Dict Num Num Num Num Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Num decorator_list decorator_list Call NameLoad Str
N/A N/A 
Braubuddy Tosr0x envcontroller unit tests.
 mock patch call MagicMock braubuddy.tests BraubuddyTestCase braubuddy.envcontroller tosr0x_usb braubuddy.envcontroller DeviceError braubuddy.envcontroller PercentageError TestTosr0x N/A BraubuddyTestCase N/A test_tosr0x_detected N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device is detected if present. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertIs N/A envcontroller _tosr0x_device mk_tosr0x_device N/A test_first_if_multiple_tosr0x_detected N/A N/A self mk_tosr0x N/A N/A N/A First Tosr0x device is detected if multiple present. N/A mk_tosr0x_device_1 N/A MagicMock N/A mk_tosr0x_device_2 N/A MagicMock N/A mk_tosr0x_device_3 N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device_1 mk_tosr0x_device_2 mk_tosr0x_device_3 N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertIs N/A envcontroller _tosr0x_device mk_tosr0x_device_1 N/A test_tosr0x_not_detected N/A N/A self mk_tosr0x N/A N/A N/A DeviceError raised if no Tosr0x devices present. N/A N/A N/A mk_tosr0x handler return_value N/A N/A N/A N/A self assertRaises DeviceError N/A N/A t N/A N/A tosr0x_usb Tosr0xEnvController N/A test_heat_set_zero N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device heater relay (#1) switched off when heat == 0. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A envcontroller set_heater_level 0 N/A N/A N/A N/A mk_tosr0x_device set_relay_position assert_called_with 1 0 N/A test_heat_set_gt_zero N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device heater relay (#1) switched on when heat > 0. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A h N/A range 1 101 N/A N/A N/A N/A envcontroller set_heater_level h N/A N/A N/A N/A mk_tosr0x_device set_relay_position assert_called_with 1 1 N/A test_cool_set_zero N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device cooler relay (#2) switched off when cool == 0. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A envcontroller set_cooler_level 0 N/A N/A N/A N/A mk_tosr0x_device set_relay_position assert_called_with 2 0 N/A test_cool_set_gt_zero N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device cooler relay (#2) switched on when cool > 0. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A h N/A range 1 101 N/A N/A N/A N/A envcontroller set_cooler_level h N/A N/A N/A N/A mk_tosr0x_device set_relay_position assert_called_with 2 1 N/A test_get_power_levels_100_percent N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device returns heating/cooling 100% when both relays on. N/A mk_tosr0x_device N/A MagicMock N/A relays_both_on N/A 1 2 1 1 N/A N/A N/A mk_tosr0x_device get_relay_positions return_value relays_both_on N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertEqual N/A N/A envcontroller get_power_levels N/A 100 100 N/A test_get_power_levels_0_percent N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device returns heating/cooling 0% when both relays off. N/A mk_tosr0x_device N/A MagicMock N/A relays_both_on N/A 1 2 0 0 N/A N/A N/A mk_tosr0x_device get_relay_positions return_value relays_both_on N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertEqual N/A N/A envcontroller get_power_levels N/A 0 0 N/A test_heat_set_invalid N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device raises a PercentageError on invalid heating value. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertRaises PercentageError N/A N/A N/A N/A envcontroller set_heater_level 101 N/A test_cool_set_invalid N/A N/A self mk_tosr0x N/A N/A N/A Tosr0x device raises a PercentageError on invalid cooling value. N/A mk_tosr0x_device N/A MagicMock N/A N/A N/A mk_tosr0x handler return_value N/A mk_tosr0x_device N/A envcontroller N/A N/A tosr0x_usb Tosr0xEnvController N/A N/A N/A self assertRaises PercentageError N/A N/A N/A N/A envcontroller set_cooler_level 101 N/A N/A N/A patch braubuddy.envcontroller.tosr0x_usb.tosr0x