A collection of classes and commands for automated command line scripting using Python.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
713 B

import pytest
from scripttease.exceptions import InvalidInput
from scripttease.lib.contexts import Context
from scripttease.lib.loaders import INILoader
class TestINILoader(object):
def test_load(self):
o = INILoader("nonexistent.ini")
assert o.load() is False
# ConfigParser raises InterpolationSyntaxError if context is not provided.
c = Context()
c.add("testing", True)
o = INILoader("tests/examples/bad_template_example.ini", context=c)
assert o.load() is False
o = INILoader("tests/examples/python_examples.ini")
assert o.load() is True
o = INILoader('tests/examples/bad_examples.ini')
assert o.load() is False