-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBackgroundUnitTests.py
More file actions
44 lines (36 loc) · 1.19 KB
/
BackgroundUnitTests.py
File metadata and controls
44 lines (36 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#1/usr/bin/python2
########################################################################
# File Name: BackgroundUnitTests.py
# Authors: Nicole Lewey and Jacob Lundgren
# Date: 12/08/2014
# Class: CS360 - Open Source
# Assignment: Ninja Game - Create Open Source Project
# Purpose: UnitTests for the background object
########################################################################
# python2 -m unittest BackgroundUnitTests
import pygame
from Background import *
import unittest
class TestBackgroundFunctions (unittest.TestCase):
def setUp (self):
""" Initialize pygame and background
"""
pygame.init()
screen = pygame.display.set_mode ((900,600))
self.background = Background()
def tearDown (self):
""" Nothing to tear down
"""
pass
def test_init (self):
""" Tests that exception is raised when the passed in file
cannot be opened
"""
self.assertRaises(SystemExit, self.background.__init__, \
imageName = 'random.png')
def test_setBackgroundImage (self):
""" Tests that exception is raised when the passed in file
cannot be opened
"""
self.assertRaises(SystemExit, self.background.__init__, \
imageName = 'random.png')