Added the boardgame tic-tac-toe without winning conditions, written entirely in Python.
This commit is contained in:
parent
0590fa6ca1
commit
affcb739b4
28 changed files with 448 additions and 0 deletions
27
games/tic-tac-toe/test_rectangle.py
Normal file
27
games/tic-tac-toe/test_rectangle.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import unittest
|
||||
from rectangle import Rectangle
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
x = 1
|
||||
y = 2
|
||||
width = 34
|
||||
height = 0.23
|
||||
r = Rectangle(x, y, width, height)
|
||||
|
||||
class TestRectangle(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.x = 1
|
||||
self.y = 2
|
||||
self.width = 34
|
||||
self.height = 0.23
|
||||
self.r = Rectangle(self.x, self.y, self.width, self.height)
|
||||
def test_attributes(self):
|
||||
self.assertEqual(self.x, self.r.x)
|
||||
self.assertEqual(self.y, self.r.y)
|
||||
self.assertEqual(self.r.width, self.r.width)
|
||||
self.assertEqual(self.r.height, self.r.height)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in a new issue