<s> from tests import unittest , unique_id <EOL> import botocore . session <EOL> import boto3 . session <EOL> class TestUserAgentCustomizations ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . botocore_session = botocore . session . get_session ( ) <EOL> self . session = boto3 . session . Session ( <EOL> region_name = '<STR_LIT>' , botocore_session = self . botocore_session ) <EOL> self . actual_user_agent = None <EOL> self . botocore_session . register ( '<STR_LIT>' , <EOL> self . record_user_agent ) <EOL> def record_user_agent ( self , request , ** kwargs ) : <EOL> self . actual_user_agent = request . headers [ '<STR_LIT>' ] <EOL> def test_client_user_agent ( self ) : <EOL> client = self . session . client ( '<STR_LIT>' ) <EOL> client . list_buckets ( ) <EOL> self . assertIn ( '<STR_LIT>' , self . actual_user_agent ) <EOL> self . assertIn ( '<STR_LIT>' , self . actual_user_agent ) <EOL> self . assertIn ( '<STR_LIT>' , self . actual_user_agent ) <EOL> self . assertNotIn ( '<STR_LIT>' , self . actual_user_agent ) <EOL> def test_resource_user_agent_has_customization ( self ) : <EOL> resource = self . session . resource ( '<STR_LIT>' ) <EOL> list ( resource . buckets . all ( ) ) <EOL> self . assertTrue ( self . actual_user_agent . endswith ( '<STR_LIT>' ) ) </s>
