Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make another test more flexible in terms of whitespaces #193

Merged
merged 2 commits into from
Oct 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion qt_dotgraph/test/pygraphviz_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import re
import unittest

try:
Expand Down Expand Up @@ -99,12 +100,15 @@ def test_create_dot(self):
fac.add_node_to_graph(g, 'edge')
fac.add_edge_to_graph(g, 'foo', 'edge')
fac.add_subgraph_to_graph(g, 'graph')
snippets = ['strict digraph "" {\n\tgraph',
snippets = ['strict digraph { graph',
'foo',
'label=foo',
'"edge"',
'label="edge"',
'foo -> "edge"']
result = fac.create_dot(g)
# get rid of version specific quotes / whitespaces
result = re.sub('""', ' ', result)
result = re.sub('[\n\t ]+', ' ', result)
for sn in snippets:
self.assertTrue(sn in result, '%s \nmissing in\n %s' % (sn, result))