<s> """<STR_LIT>""" <EOL> import random <EOL> import unittest <EOL> from hypothesis import given <EOL> from hypothesis . strategies import sampled_from , lists , integers <EOL> from axelrod import Actions <EOL> from axelrod . _strategy_utils import detect_cycle <EOL> C , D = Actions . C , Actions . D <EOL> class TestDetectCycle ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ given ( cycle = lists ( sampled_from ( [ C , D ] ) , min_size = <NUM_LIT:2> , max_size = <NUM_LIT:10> ) , <EOL> period = integers ( min_value = <NUM_LIT:3> , max_value = <NUM_LIT:10> ) ) <EOL> def test_finds_cycle ( self , cycle , period ) : <EOL> history = cycle * period <EOL> self . assertIsNotNone ( detect_cycle ( history ) ) <EOL> def test_no_cycle ( self ) : <EOL> history = [ C , D , C , C ] <EOL> self . assertIsNone ( detect_cycle ( history ) ) <EOL> history = [ D , D , C , C , C ] <EOL> self . assertIsNone ( detect_cycle ( history ) ) </s>
