<s> import json <EOL> from functionaltests . api import base <EOL> class VersionDiscoveryTestCase ( base . TestCase ) : <EOL> def test_get_root_discovers_v1 ( self ) : <EOL> resp , body = self . client . get ( '<STR_LIT:/>' ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) <EOL> def test_delete_root_discovers_v1 ( self ) : <EOL> resp , body = self . client . delete ( '<STR_LIT:/>' ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) <EOL> def test_post_root_discovers_v1 ( self ) : <EOL> resp , body = self . client . post ( '<STR_LIT:/>' , '<STR_LIT:{}>' ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) <EOL> def test_put_root_discovers_v1 ( self ) : <EOL> resp , body = self . client . put ( '<STR_LIT:/>' , '<STR_LIT:{}>' ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) <EOL> def test_post_no_body_root_discovers_v1 ( self ) : <EOL> self . skipTest ( "<STR_LIT>" ) <EOL> resp , body = self . client . post ( '<STR_LIT:/>' , None ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) <EOL> def test_put_no_body_root_discovers_v1 ( self ) : <EOL> self . skipTest ( "<STR_LIT>" ) <EOL> resp , body = self . client . put ( '<STR_LIT:/>' , None ) <EOL> body = json . loads ( body ) <EOL> self . assertEqual ( resp . status , <NUM_LIT:200> ) <EOL> self . assertEqual ( len ( body ) , <NUM_LIT:1> ) <EOL> v1 = body [ <NUM_LIT:0> ] <EOL> self . assertEqual ( v1 [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( v1 [ '<STR_LIT>' ] [ '<STR_LIT>' ] , '<STR_LIT>' % self . client . base_url ) </s>
