<s> """<STR_LIT>""" <EOL> import time <EOL> from tests . unit import unittest <EOL> from boto . cloudsearch2 . layer1 import CloudSearchConnection <EOL> from boto . cloudsearch2 . layer2 import Layer2 <EOL> from boto . regioninfo import RegionInfo <EOL> class CloudSearchLayer1Test ( unittest . TestCase ) : <EOL> cloudsearch = True <EOL> def setUp ( self ) : <EOL> super ( CloudSearchLayer1Test , self ) . setUp ( ) <EOL> self . layer1 = CloudSearchConnection ( ) <EOL> self . domain_name = '<STR_LIT>' % int ( time . time ( ) ) <EOL> def test_create_domain ( self ) : <EOL> resp = self . layer1 . create_domain ( self . domain_name ) <EOL> resp = ( resp [ '<STR_LIT>' ] <EOL> [ '<STR_LIT>' ] <EOL> [ '<STR_LIT>' ] ) <EOL> self . addCleanup ( self . layer1 . delete_domain , self . domain_name ) <EOL> self . assertTrue ( resp . get ( '<STR_LIT>' , False ) ) <EOL> class CloudSearchLayer2Test ( unittest . TestCase ) : <EOL> cloudsearch = True <EOL> def setUp ( self ) : <EOL> super ( CloudSearchLayer2Test , self ) . setUp ( ) <EOL> self . layer2 = Layer2 ( ) <EOL> self . domain_name = '<STR_LIT>' % int ( time . time ( ) ) <EOL> def test_create_domain ( self ) : <EOL> domain = self . layer2 . create_domain ( self . domain_name ) <EOL> self . addCleanup ( domain . delete ) <EOL> self . assertTrue ( domain . created , False ) <EOL> self . assertEqual ( domain . domain_name , self . domain_name ) <EOL> def test_initialization_regression ( self ) : <EOL> us_west_2 = RegionInfo ( <EOL> name = '<STR_LIT>' , <EOL> endpoint = '<STR_LIT>' <EOL> ) <EOL> self . layer2 = Layer2 ( <EOL> region = us_west_2 , <EOL> host = '<STR_LIT>' <EOL> ) <EOL> self . assertEqual ( <EOL> self . layer2 . layer1 . host , <EOL> '<STR_LIT>' <EOL> ) </s>
