Exemplo n.º 1
0
    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))
Exemplo n.º 2
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)
Exemplo n.º 3
0
    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)))
Exemplo n.º 4
0
    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)))
Exemplo n.º 5
0
    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))
Exemplo n.º 6
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)