File: test_unicode_issues.py

package info (click to toggle)
python-igraph 0.11.8%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,480 kB
  • sloc: ansic: 24,545; python: 21,699; sh: 107; makefile: 35; sed: 2
file content (27 lines) | stat: -rw-r--r-- 696 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
from igraph import Graph


class UnicodeTests(unittest.TestCase):
    def testBug128(self):
        y = [1, 4, 9]
        g = Graph(n=len(y), directed=True, vertex_attrs={"y": y})
        self.assertEqual(3, g.vcount())
        g.add_vertices(1)
        # Bug #128 would prevent us from reaching the next statement
        # because an exception would have been thrown here
        self.assertEqual(4, g.vcount())


def suite():
    generator_suite = unittest.defaultTestLoader.loadTestsFromTestCase(UnicodeTests)
    return unittest.TestSuite([generator_suite])


def test():
    runner = unittest.TextTestRunner()
    runner.run(suite())


if __name__ == "__main__":
    test()