Пример #1
0
    def test_decode_datetime_error():
        """ Test that the JsonDeserializer.decode_datetime raises an error if no decoding is defined. """
        # Arrange
        value = {"foo": "bar"}

        # Act & Assert
        with pytest.raises(NotImplementedError):
            JsonDeserializer.decode_datetime(value)
Пример #2
0
    def test_decode_datetime(value, expected):
        """ Test that the JsonDeserializer.decode_datetime decodes values as expected. """
        # Arrange

        # Act
        result = JsonDeserializer.decode_datetime(value)

        # Assert
        assert result == expected