def test_RGBListHasBlankInFront(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = ( 0, ) * PressureHistory.MAXLEN ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(ledAdapter.asHatRGBList()[0], (0, 0, 0))
def test_RGBListIs64ElementsLong(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = ( 0, ) * PressureHistory.MAXLEN ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(len(ledAdapter.asHatRGBList()), 64)
def test_extermeNormalizedPressuresResultInRedToBlueWithBlankInFront(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = (0,1) ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(ledAdapter.asHatRGBList(),((0,0,0),(255,0,0),(0,0,255)))
def test_extermeNormalizedPressuresResultInRedToBlueWithBlankInFront(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = (0, 1) ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(ledAdapter.asHatRGBList(), ((0, 0, 0), (255, 0, 0), (0, 0, 255)))
def test_RGBListHasBlankInFront(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = (0,)*PressureHistory.MAXLEN ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(ledAdapter.asHatRGBList()[0],(0,0,0))
def test_RGBListIs64ElementsLong(self): mock_pressureHistory = mock.create_autospec(PressureHistory) mock_pressureHistory.normalized.return_value = (0,)*PressureHistory.MAXLEN ledAdapter = LEDMatrixAdapter(mock_pressureHistory) self.assertEqual(len(ledAdapter.asHatRGBList()),64)