[go: up one dir, main page]

File: test_path.py

package info (click to toggle)
solfege 3.10.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 12,408 kB
  • ctags: 4,270
  • sloc: python: 22,161; xml: 7,536; ansic: 4,442; makefile: 685; sh: 308
file content (23 lines) | stat: -rw-r--r-- 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Solfege - free ear training software
# Copyright (C) 2007, 2008 Tom Cato Amundsen
# License is GPL, see file COPYING

import unittest
from src.gpath import Path

class TestPath(unittest.TestCase):
    def test_next(self):
        p = Path((1, 2, 3))
        self.assert_(p.next(), (1, 2, 4))
    def test_prev(self):
        p = Path((1, 2, 3))
        self.assert_(p.prev(), (1, 2, 2))
    def test_child(self):
        p = Path((1, 2, 3))
        self.assert_(p.child(), (1, 2, 3, 0))
    def test_parent(self):
        p = Path((1, 2, 3))
        self.assert_(p.parent(), (1, 2))

suite = unittest.makeSuite(TestPath)