<s> import mox <EOL> import decimal <EOL> from stacktach import utils as stacktach_utils <EOL> from utils import INSTANCE_ID_1 <EOL> from utils import MESSAGE_ID_1 <EOL> from utils import REQUEST_ID_1 <EOL> from tests . unit import StacktachBaseTestCase <EOL> class StacktachUtilsTestCase ( StacktachBaseTestCase ) : <EOL> def setUp ( self ) : <EOL> self . mox = mox . Mox ( ) <EOL> def tearDown ( self ) : <EOL> self . mox . UnsetStubs ( ) <EOL> def test_is_uuid_like ( self ) : <EOL> uuid = INSTANCE_ID_1 <EOL> self . assertTrue ( stacktach_utils . is_uuid_like ( uuid ) ) <EOL> def test_is_uuid_like_no_dashes ( self ) : <EOL> uuid = "<STR_LIT>" <EOL> self . assertTrue ( stacktach_utils . is_uuid_like ( uuid ) ) <EOL> def test_is_uuid_like_invalid ( self ) : <EOL> uuid = "<STR_LIT>" <EOL> self . assertFalse ( stacktach_utils . is_uuid_like ( uuid ) ) <EOL> def test_is_request_id_like_with_uuid ( self ) : <EOL> uuid = MESSAGE_ID_1 <EOL> self . assertTrue ( stacktach_utils . is_request_id_like ( uuid ) ) <EOL> def test_is_message_id_like_with_req_uuid ( self ) : <EOL> uuid = REQUEST_ID_1 <EOL> self . assertTrue ( stacktach_utils . is_request_id_like ( uuid ) ) <EOL> def test_is_message_id_like_invalid_req ( self ) : <EOL> uuid = "<STR_LIT>" <EOL> self . assertFalse ( stacktach_utils . is_request_id_like ( uuid ) ) <EOL> def test_is_message_id_like_invalid ( self ) : <EOL> uuid = "<STR_LIT>" <EOL> self . assertFalse ( stacktach_utils . is_request_id_like ( uuid ) ) <EOL> def test_str_time_to_unix ( self ) : <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) ) <EOL> with self . assertRaises ( Exception ) : <EOL> stacktach_utils . str_time_to_unix ( "<STR_LIT>" ) , <EOL> decimal . Decimal ( '<STR_LIT>' ) </s>
