def test_set_mode_wave(self): """ Test setting each bit in the mode individually 0 WAVE_DATA_RATE = 'wave_data_rate' 1 WAVE_CELL_POS = 'wave_cell_position' 2 DYNAMIC_POS_TYPE = 'dynamic_position_type' """ uc = UserConfiguration(user_config_sample()) uc.mode_wave = 0 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b1 self.assertEqual(uc.wave_data_rate, 1) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b10 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 1) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b100 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 1)
def test_set_mode_wave(self): """ Test setting each bit in the mode individually 0 WAVE_DATA_RATE = 'wave_data_rate' 1 WAVE_CELL_POS = 'wave_cell_position' 2 DYNAMIC_POS_TYPE = 'dynamic_position_type' """ uc = UserConfiguration(user_config_sample()) uc.mode_wave = 0 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b1 self.assertEqual(uc.wave_data_rate, 1) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b10 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 1) self.assertEqual(uc.dynamic_position_type, 0) uc.mode_wave = 0b100 self.assertEqual(uc.wave_data_rate, 0) self.assertEqual(uc.wave_cell_position, 0) self.assertEqual(uc.dynamic_position_type, 1)
def test_mode_wave_bit_set(self): uc = UserConfiguration(user_config_sample()) uc.mode_wave = 0 uc.wave_data_rate = 1 self.assertEqual(uc.mode_wave, 0b1) uc.wave_cell_position = 1 self.assertEqual(uc.mode_wave, 0b11) uc.dynamic_position_type = 1 self.assertEqual(uc.mode_wave, 0b111)
def test_mode_wave_bit_set(self): uc = UserConfiguration(user_config_sample()) uc.mode_wave = 0 uc.wave_data_rate = 1 self.assertEqual(uc.mode_wave, 0b1) uc.wave_cell_position = 1 self.assertEqual(uc.mode_wave, 0b11) uc.dynamic_position_type = 1 self.assertEqual(uc.mode_wave, 0b111)