<s> from changes . api . serializer import serialize <EOL> from changes . config import db <EOL> from changes . models import ProjectOption <EOL> from changes . testutils import TestCase <EOL> class JobStepCrumblerTestCase ( TestCase ) : <EOL> def test_associated_snapshot_image ( self ) : <EOL> project = self . create_project ( ) <EOL> build = self . create_build ( project = project ) <EOL> plan = self . create_plan ( project ) <EOL> job = self . create_job ( build = build ) <EOL> snapshot = self . create_snapshot ( project ) <EOL> image = self . create_snapshot_image ( plan = plan , snapshot = snapshot ) <EOL> self . create_option ( item_id = plan . id , name = '<STR_LIT>' , value = '<STR_LIT:1>' ) <EOL> db . session . add ( ProjectOption ( project_id = project . id , <EOL> name = '<STR_LIT>' , <EOL> value = snapshot . id . hex ) ) <EOL> db . session . commit ( ) <EOL> self . create_job_plan ( job = job , plan = plan , snapshot_id = snapshot . id ) <EOL> phase = self . create_jobphase ( job ) <EOL> jobstep = self . create_jobstep ( phase ) <EOL> result = serialize ( jobstep ) <EOL> assert result [ '<STR_LIT:image>' ] [ '<STR_LIT:id>' ] == image . id . hex </s>
