<s> import unittest <EOL> import os <EOL> from nymms . config import yaml_config <EOL> class TestIncludeLoader ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . root = os . path . dirname ( __file__ ) <EOL> def test_relative_include ( self ) : <EOL> full_path = os . path . join ( self . root , '<STR_LIT>' ) <EOL> version , relative_config = yaml_config . load_config ( full_path ) <EOL> self . assertEqual ( relative_config [ '<STR_LIT:foo>' ] , '<STR_LIT:bar>' ) <EOL> self . assertEqual ( relative_config [ '<STR_LIT>' ] , <NUM_LIT:1> ) <EOL> def test_missing_config ( self ) : <EOL> with self . assertRaises ( IOError ) : <EOL> yaml_config . load_config ( '<STR_LIT>' ) <EOL> def test_indent_include ( self ) : <EOL> full_path = os . path . join ( self . root , '<STR_LIT>' ) <EOL> version , relative_config = yaml_config . load_config ( full_path ) <EOL> self . assertEqual ( relative_config [ '<STR_LIT>' ] [ '<STR_LIT:a>' ] , <NUM_LIT:1> ) <EOL> def test_empty_config ( self ) : <EOL> full_path = os . path . join ( self . root , '<STR_LIT>' ) <EOL> with self . assertRaises ( yaml_config . EmptyConfig ) as ee : <EOL> yaml_config . load_config ( full_path ) <EOL> self . assertEqual ( ee . exception . filename , full_path ) </s>
