def test_valid_baud_rate(self): self.assertEqual( Flasher.is_valid_baud_rate([ '17', 'A5', 'D8', '46', # magic number '02', # struct version 'FF', 'FF', 'FF', # (reserved for future use) '00', '00', '00', '00', # revision hash '01', '02', '00', # major, minor, patch 'FF', # (reserved for future use) '03', # softdevice ble api number '01', # transport type 'FF', 'FF', # (reserved for future use) '00', 'C2', '01', '00' # baud rate ]), True)
def test_valid_baud_rate(self): self.assertEqual(Flasher.is_valid_baud_rate( ['17', 'A5', 'D8', '46', # magic number '02', # struct version 'FF', 'FF', 'FF', # (reserved for future use) '00', '00', '00', '00', # revision hash '01', '02', '00', # major, minor, patch 'FF', # (reserved for future use) '03', # softdevice ble api number '01', # transport type 'FF', 'FF', # (reserved for future use) '00', 'C2', '01', '00' # baud rate ]), True)
def test_valid_baud_rate(self): self.assertTrue(Flasher.is_valid_baud_rate(1000000))
def test_invalid_baud_rate(self): self.assertFalse(Flasher.is_valid_baud_rate(115200))