Question: For instance, let s say we are creating a class called Point to store a 2 - D point. We might create the following skeleton

For instance, lets say we are creating a class called Point to store a 2-D point. We might create the following
skeleton code and unittest for our first TDD loop:
Point.py
class Point:
def __init__(self, x, y):
"""Initializes a 2-D point with x- and y- coordinates"""
pass
TestPoint.py
import unittest
from Point import Point # import class Point from file Point.py
class TestPoint(unittest.TestCase):
def setUp(self):
"""Create some points for future tests"""
self.p1= Point(3,4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!