<s> import os <EOL> import pytest <EOL> from supernova import config <EOL> class TestConfig ( object ) : <EOL> def test_run_config ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> result = config . run_config ( testcfg ) <EOL> assert result is not None <EOL> assert len ( result . keys ( ) ) == <NUM_LIT:7> <EOL> assert '<STR_LIT>' in result . keys ( ) <EOL> def test_get_config_file ( self ) : <EOL> result = config . get_config_file ( ) <EOL> assert result is not None <EOL> assert result == '<STR_LIT>' <EOL> def test_read_valid_configuration ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> result = config . load_config ( config_file_override = testcfg ) <EOL> assert result is not None <EOL> assert len ( result . keys ( ) ) == <NUM_LIT:7> <EOL> assert '<STR_LIT>' in result . keys ( ) <EOL> def test_read_missing_configuration ( self ) : <EOL> testcfg = "<STR_LIT>" <EOL> result = None <EOL> with pytest . raises ( Exception ) as excinfo : <EOL> result = config . load_config ( config_file_override = testcfg ) <EOL> assert result is None <EOL> assert "<STR_LIT>" in str ( excinfo . value ) <EOL> def test_override_with_non_string ( self ) : <EOL> testcfg = "<STR_LIT>" <EOL> result = None <EOL> with pytest . raises ( Exception ) as excinfo : <EOL> result = config . load_config ( config_file_override = [ testcfg ] ) <EOL> assert result is None <EOL> assert "<STR_LIT>" in str ( excinfo . value ) <EOL> class TestDynamicConfig ( object ) : <EOL> def test_bad_config_arg ( self ) : <EOL> result = None <EOL> with pytest . raises ( ValueError ) as val_error : <EOL> result = config . create_dynamic_configs ( '<STR_LIT>' ) <EOL> assert result is None <EOL> assert "<STR_LIT>" in str ( val_error ) <EOL> def test_dynamic_sections_without_default ( self ) : <EOL> result = config . load_config ( ) <EOL> result [ '<STR_LIT>' ] = { '<STR_LIT>' : "<STR_LIT>" } <EOL> config . create_dynamic_configs ( result ) <EOL> assert '<STR_LIT>' in result . sections <EOL> assert '<STR_LIT>' in result . sections <EOL> assert '<STR_LIT>' not in result . sections <EOL> assert '<STR_LIT>' in result [ '<STR_LIT>' ] . get ( '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == result [ '<STR_LIT>' ] . get ( '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == result [ '<STR_LIT>' ] . get ( '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == result [ '<STR_LIT>' ] . get ( '<STR_LIT>' ) </s>
