meejah/txtorcon — pull request #27 by lukaslueg (2012-12-29 16:21:28+00:00)
Title: Graphviz may not be available during tests

Hi,

a small change to test_fsm.py that handles graphviz not being available while testing. Instead of bailing out with an error, we test as much as be can and succeed the test even if dot is not available. This allows the test-suite to run to completion without having to declare graphviz a build-time requirement.

The usage of os.system is replaced by subprocess.check_output; the tempfile was neither flushed nor closed, which may cause dot to fail in case the file was not synced to the fs; we also make sure the tempfile is unlinked even if the test fails.

Also some small whitespace/pep8 fixes and cleanups to that file.