File: test_line.py

package info (click to toggle)
python-beziers 0.6.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 672 kB
  • sloc: python: 3,160; makefile: 20
file content (13 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import unittest
from beziers.line import Line
from beziers.point import Point

class LineMethods(unittest.TestCase):
  def test_slope(self):
    l = Line(Point(0,10),Point(20,20.4))
    self.assertAlmostEqual(l.slope, 0.52)

  def test_intercept(self):
    l = Line(Point(0,10),Point(20,20.4))
    self.assertAlmostEqual(l.intercept, 10)