<s> import time <EOL> import unittest <EOL> from robotide . robotapi import TestCaseFile <EOL> from robotide . controller . filecontrollers import TestCaseFileController <EOL> from resources import COMPLEX_SUITE_PATH <EOL> from nose . tools import assert_equals , assert_true <EOL> class TestCaseAndUserKeywordCopyingTest ( unittest . TestCase ) : <EOL> controller = TestCaseFileController ( <EOL> TestCaseFile ( source = COMPLEX_SUITE_PATH ) . populate ( ) ) <EOL> def test_test_case_copy ( self ) : <EOL> test = self . controller . tests [ <NUM_LIT:0> ] <EOL> copy = test . copy ( '<STR_LIT>' ) <EOL> assert_equals ( copy . name , '<STR_LIT>' ) <EOL> for orig , copied in zip ( test . settings , copy . settings ) : <EOL> assert_equals ( orig . value , copied . value ) <EOL> assert_true ( copied is not orig ) <EOL> assert_equals ( test . steps , copy . steps ) <EOL> assert_true ( test . steps is not copy . steps ) <EOL> def test_keyword_copy ( self ) : <EOL> test = self . controller . keywords [ <NUM_LIT:0> ] <EOL> copy = test . copy ( '<STR_LIT>' ) <EOL> assert_equals ( copy . name , '<STR_LIT>' ) <EOL> for orig , copied in zip ( test . settings , copy . settings ) : <EOL> assert_equals ( orig . value , copied . value ) <EOL> assert_true ( copied is not orig ) <EOL> assert_equals ( test . steps , copy . steps ) <EOL> assert_true ( test . steps is not copy . steps ) <EOL> def test_test_copy_performance ( self ) : <EOL> self . _run_copy_test ( self . controller . tests [ <NUM_LIT:0> ] ) <EOL> def test_keyword_copy_performance ( self ) : <EOL> self . _run_copy_test ( self . controller . keywords [ <NUM_LIT:0> ] ) <EOL> def _run_copy_test ( self , item ) : <EOL> self . _test_copy ( item , <NUM_LIT:10> ) <EOL> self . _test_copy ( item , <NUM_LIT:200> ) <EOL> def _test_copy ( self , item , count ) : <EOL> start_time = time . time ( ) <EOL> for i in range ( <NUM_LIT:0> , count ) : <EOL> item . copy ( str ( i ) ) <EOL> self . assertTrue ( time . time ( ) < ( start_time + <NUM_LIT:2> ) , <EOL> "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
