File: test_drawing.py

package info (click to toggle)
python-pygraphviz 1.3.1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 664 kB
  • sloc: ansic: 4,970; python: 2,523; makefile: 152
file content (26 lines) | stat: -rw-r--r-- 653 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
# -*- coding: utf-8 -*-
from nose.tools import *
import pygraphviz as pgv

@raises(AttributeError)
def test_drawing_error():
    A = pgv.AGraph(name='test graph')
    A.add_path([1,2,3,4])
    d = A.draw()

# this is not a very good way to test...
#def test_drawing():
#    A = pgv.AGraph(name='test graph')
#    A.add_path([1,2,3,4])
#    d = A.draw(prog='neato')
#    assert_equal(len(d.splitlines()),19)
# FIXME
# smoke test
# >>> (fd,fname)=tempfile.mkstemp()
# >>> A.draw(fname,format='ps',prog='neato')
# >>> A.draw(fname,prog='neato')

@raises(ValueError)
def test_name_error():
    A = pgv.AGraph(name='test graph')
    A.draw('foo',prog='foo')