File: test_gfapy_segment_references.py

package info (click to toggle)
gfapy 1.0.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,932 kB
  • sloc: python: 11,549; sh: 167; makefile: 66
file content (16 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gfapy
import unittest

class TestSegmentReferences(unittest.TestCase):

  def test_link_other(self):
    l = gfapy.Line("L\t1\t+\t2\t-\t*")
    self.assertEqual("2", l.other("1"))
    self.assertEqual("1", l.other("2"))
    self.assertRaises(gfapy.NotFoundError, l.other, "0")

  def test_link_circular(self):
    l = gfapy.Line("L\t1\t+\t2\t-\t*")
    self.assertEqual(False, l.is_circular())
    l = gfapy.Line("L\t1\t+\t1\t-\t*")
    self.assertEqual(True, l.is_circular())