def test_update_0_0_0_4(self, mock_output):
        # Arrange
        x = Output(0, 0, 0, 4)

        # Act
        result = self._unitUnderTest.update(x)

        # Assert
        self.assertEqual(4, mock_output.call_count)
        mock_output.assert_any_call(self._tubeA, (0, 0, 0, 0))
        mock_output.assert_any_call(self._tubeB, (0, 0, 0, 0))
        mock_output.assert_any_call(self._tubeC, (0, 0, 0, 0))
        mock_output.assert_any_call(self._tubeD, (0, 1, 0, 0))
Example #2
0
    def test_constructor(self):
        # Arrange
        a = 1
        b = 5
        c = 8
        d = 4

        # Act
        obj = Output(a, b, c, d)

        # Assert
        map(self.assertIsInstance, [int, int, int, int],
            [obj.tubeA, obj.tubeB, obj.tubeC, obj.tubeD])
        map(self.assertEqual, [a, b, c, d],
            [obj.tubeA, obj.tubeB, obj.tubeC, obj.tubeD])
Example #3
0
def map_callback(dateTime: Type[datetime]) -> Output:
    x = dateTime.strftime("%H %M").split(" ")
    return Output(int(x[0][0]), int(x[0][1]), int(x[1][0]), int(x[1][1]))