<s> import unittest2 <EOL> from chef import Client <EOL> from chef . tests import ChefTestCase <EOL> class ClientTestCase ( ChefTestCase ) : <EOL> def test_list ( self ) : <EOL> self . assertIn ( '<STR_LIT>' , Client . list ( ) ) <EOL> def test_get ( self ) : <EOL> client = Client ( '<STR_LIT>' ) <EOL> self . assertTrue ( client . platform ) <EOL> self . assertEqual ( client . orgname , '<STR_LIT>' ) <EOL> self . assertTrue ( client . public_key ) <EOL> self . assertTrue ( client . certificate ) <EOL> self . assertEqual ( client . private_key , None ) <EOL> def test_create ( self ) : <EOL> name = self . random ( ) <EOL> client = Client . create ( name ) <EOL> self . register ( client ) <EOL> self . assertEqual ( client . name , name ) <EOL> self . assertTrue ( client . private_key ) <EOL> self . assertTrue ( client . public_key ) <EOL> self . assertIn ( name , Client . list ( ) ) <EOL> client2 = Client ( name ) <EOL> client2 . rekey ( ) <EOL> self . assertEqual ( client . public_key , client2 . public_key ) <EOL> self . assertNotEqual ( client . private_key , client2 . private_key ) <EOL> def test_delete ( self ) : <EOL> name = self . random ( ) <EOL> client = Client . create ( name ) <EOL> client . delete ( ) <EOL> self . assertNotIn ( name , Client . list ( ) ) </s>
