summaryrefslogtreecommitdiff
path: root/grc/tests/test_xml_parser.py
blob: 28ec770cf6f0ab560db0eccfa9ae742af4589b5b (plain)
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
28
29
# Copyright 2017 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

from os import path
import sys

from grc.converter import flow_graph


def test_flow_graph_converter():
    filename = path.join(path.dirname(__file__),
                         'resources', 'test_compiler.grc')

    data = flow_graph.from_xml(filename)

    flow_graph.dump(data, sys.stdout)


def test_flow_graph_converter_with_fp():
    filename = path.join(path.dirname(__file__),
                         'resources', 'test_compiler.grc')

    with open(filename, 'rb') as fp:
        data = flow_graph.from_xml(fp)

    flow_graph.dump(data, sys.stdout)