<s> from unittest . mock import MagicMock <EOL> import pytest <EOL> class TestAnnotate : <EOL> @ pytest . fixture <EOL> def annotate ( self ) : <EOL> from palladium . interfaces import annotate <EOL> return annotate <EOL> def test_with_existing_data ( self , annotate ) : <EOL> model = MagicMock ( __metadata__ = { '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:2> } ) <EOL> annotate ( model , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert model . __metadata__ [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert model . __metadata__ [ '<STR_LIT>' ] == <NUM_LIT:2> <EOL> assert annotate ( model ) == { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:2> } <EOL> def test_without_existing_data ( self , annotate ) : <EOL> model = TestAnnotate ( ) <EOL> assert annotate ( model , { '<STR_LIT>' : '<STR_LIT>' } ) == { '<STR_LIT>' : '<STR_LIT>' } <EOL> assert model . __metadata__ [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> class TestPredictError : <EOL> @ pytest . fixture <EOL> def PredictError ( self ) : <EOL> from palladium . interfaces import PredictError <EOL> return PredictError <EOL> def test_str ( self , PredictError ) : <EOL> assert str ( PredictError ( "<STR_LIT:message>" , <NUM_LIT> ) ) == "<STR_LIT>" </s>
