Commit 9f572101 authored by Jay's avatar Jay Committed by jay
Browse files

Coverage for structured readers

parent 230ac165
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ try:
except:
    print('YAML package not installed, disabling yaml_io module')


def read_yaml(inputfile):
    """
    Read the input yaml file into a python dictionary
@@ -20,7 +21,6 @@ def read_yaml(inputfile):
    try:
        with open(inputfile, 'r') as f:
            ydict = yaml.load(f)

    except:
    except: # pragma: no cover
        raise IOError('Unable to load YAML file.')
    return ydict
+0 −0

Empty file deleted.

+20 −0
Original line number Diff line number Diff line
import unittest

from .. import io_yaml
from .. import io_json

from autocnet.examples import get_path


class TestYAML(unittest.TestCase):

    def test_read(self):
        d = io_yaml.read_yaml(get_path('logging.yaml'))
        self.assertIn('handlers', d.keys())


class TestJSON(unittest.TestCase):

    def test_read(self):
        d = io_json.read_json(get_path('logging.json'))
        self.assertIn('handlers', d.keys())