<s> from uuid import uuid4 <EOL> from changes . testutils import APITestCase <EOL> class ProjectCommitDetailsTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> fake_commit_id = uuid4 ( ) <EOL> project = self . create_project ( ) <EOL> build = self . create_build ( project ) <EOL> self . create_job ( build ) <EOL> project2 = self . create_project ( ) <EOL> revision = self . create_revision ( repository = project2 . repository ) <EOL> source = self . create_source ( project2 , revision_sha = revision . sha ) <EOL> build = self . create_build ( project2 , source = source ) <EOL> path = '<STR_LIT>' . format ( <EOL> project . id . hex , fake_commit_id ) <EOL> resp = self . client . get ( path ) <EOL> assert resp . status_code == <NUM_LIT> <EOL> path = '<STR_LIT>' . format ( <EOL> project2 . id . hex , revision . sha ) <EOL> resp = self . client . get ( path ) <EOL> assert resp . status_code == <NUM_LIT:200> <EOL> data = self . unserialize ( resp ) <EOL> assert len ( data ) == <NUM_LIT:1> <EOL> assert data [ <NUM_LIT:0> ] [ '<STR_LIT:id>' ] == build . id . hex </s>
