Exemplo n.º 1
0
    def testHueListMapsNoneToNone(self):
        mock_pressureHistory = mock.create_autospec(PressureHistory)
        mock_pressureHistory.normalized.return_value = (None, )

        ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
        hueList = ledAdapter.asHueList()
        self.assertEqual(hueList, (None, ))
Exemplo n.º 2
0
    def test_hueListIsInRedBlueRange(self):
        mock_pressureHistory = mock.create_autospec(PressureHistory)
        mock_pressureHistory.normalized.return_value = (0, 1)

        ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
        hueList = ledAdapter.asHueList()
        self.assertEqual(hueList, (ledAdapter.MINHUE, ledAdapter.MAXHUE))
Exemplo n.º 3
0
    def testHueListMapsNoneToNone(self):
        mock_pressureHistory = mock.create_autospec(PressureHistory)
        mock_pressureHistory.normalized.return_value = (None,)

        ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
        hueList = ledAdapter.asHueList()
        self.assertEqual(hueList,(None,))
Exemplo n.º 4
0
    def test_hueListIsInRedBlueRange(self):
        mock_pressureHistory = mock.create_autospec(PressureHistory)
        mock_pressureHistory.normalized.return_value = (0,1)

        ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
        hueList = ledAdapter.asHueList()
        self.assertEqual(hueList,(ledAdapter.MINHUE,ledAdapter.MAXHUE))
Exemplo n.º 5
0
 def test_hueListretrievesNormalizedHistory(self):
     mock_pressureHistory = mock.create_autospec(PressureHistory)
     ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
     ledAdapter.asHueList()
     self.assertTrue(mock_pressureHistory.normalized.called,
                     "Didn't get the normalized pressure history")
Exemplo n.º 6
0
 def test_hueListretrievesNormalizedHistory(self):
     mock_pressureHistory = mock.create_autospec(PressureHistory)
     ledAdapter = LEDMatrixAdapter(mock_pressureHistory)
     ledAdapter.asHueList()
     self.assertTrue(mock_pressureHistory.normalized.called,"Didn't get the normalized pressure history")