Exemple #1
0
    def test_decode_numeric_error():
        """ Test that the JsonDeserializer.decode_numeric raises an error if no decoding is defined. """
        # Arrange
        value = {"numeric": "decimal", "value": "3.14"}

        # Act & Assert
        with pytest.raises(NotImplementedError):
            JsonDeserializer.decode_numeric(value)
Exemple #2
0
    def test_decode_numeric(expected, value):
        """ Test that the JsonDeserializer.decode_numeric decodes values as expected. """
        # Arrange

        # Act
        result = JsonDeserializer.decode_numeric(value)

        # Assert
        assert result == expected