<s> import unittest <EOL> from pygame . rect import Rect <EOL> from pyplatformerengine . utilities . CameraMan import CameraMan <EOL> class TestCameraMan ( unittest . TestCase ) : <EOL> def testCamaraManPopulatesAttributes ( self ) : <EOL> cameraMan = CameraMan ( <NUM_LIT:100> , <NUM_LIT:100> ) <EOL> self . assertEqual ( <NUM_LIT:100> , cameraMan . screenHeight , "<STR_LIT>" ) <EOL> self . assertEqual ( <NUM_LIT:100> , cameraMan . screenWidth , "<STR_LIT>" ) <EOL> self . assertEqual ( <NUM_LIT:50> , cameraMan . halfHeight , "<STR_LIT>" ) <EOL> self . assertEqual ( <NUM_LIT:50> , cameraMan . halfHeight , "<STR_LIT>" ) <EOL> def testCanStopAtLeftEdge ( self ) : <EOL> entityRect = Rect ( - <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:100> , <NUM_LIT:100> ) <EOL> cameraRect = Rect ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) <EOL> cameraMan = CameraMan ( <NUM_LIT> , <NUM_LIT> ) <EOL> l , _ , _ , _ = cameraMan . complexCamera ( cameraRect , entityRect ) <EOL> self . assertEqual ( <NUM_LIT:0> , l , "<STR_LIT>" ) <EOL> def testCanStopAtRightEdge ( self ) : <EOL> entityRect = Rect ( <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:100> , <NUM_LIT:100> ) <EOL> cameraRect = Rect ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) <EOL> cameraMan = CameraMan ( <NUM_LIT> , <NUM_LIT> ) <EOL> l , _ , _ , _ = cameraMan . complexCamera ( cameraRect , entityRect ) <EOL> self . assertEqual ( - <NUM_LIT> , l , "<STR_LIT>" ) <EOL> def testCanStopAtTopEdge ( self ) : <EOL> entityRect = Rect ( <NUM_LIT:0> , - <NUM_LIT:5> , <NUM_LIT:100> , <NUM_LIT:100> ) <EOL> cameraRect = Rect ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) <EOL> cameraMan = CameraMan ( <NUM_LIT> , <NUM_LIT> ) <EOL> _ , t , _ , _ = cameraMan . complexCamera ( cameraRect , entityRect ) <EOL> self . assertEqual ( <NUM_LIT:0> , t , "<STR_LIT>" ) <EOL> def testCanStopAtBottomEdge ( self ) : <EOL> entityRect = Rect ( <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT:100> , <NUM_LIT:100> ) <EOL> cameraRect = Rect ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) <EOL> cameraMan = CameraMan ( <NUM_LIT> , <NUM_LIT> ) <EOL> _ , t , _ , _ = cameraMan . complexCamera ( cameraRect , entityRect ) <EOL> self . assertEqual ( <NUM_LIT:0> , t , "<STR_LIT>" ) </s>
