<s> import pytest <EOL> from expecter import expect <EOL> from gitman . models import Config , load_config <EOL> from . conftest import FILES <EOL> class TestConfig : <EOL> def test_init_defaults ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == config . root <EOL> assert '<STR_LIT>' == config . filename <EOL> assert '<STR_LIT>' == config . location <EOL> assert [ ] == config . sources <EOL> def test_init_filename ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == config . filename <EOL> assert '<STR_LIT>' == config . location <EOL> def test_init_location ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( '<STR_LIT>' , location = '<STR_LIT>' ) <EOL> assert '<STR_LIT>' == config . filename <EOL> assert '<STR_LIT>' == config . location <EOL> def test_path ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( '<STR_LIT>' ) <EOL> assert "<STR_LIT>" == config . path <EOL> @ pytest . mark . integration <EOL> def test_install_and_list ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( ) <EOL> assert <NUM_LIT:7> == count <EOL> deps = list ( config . get_deps ( ) ) <EOL> assert <NUM_LIT:7> == len ( deps ) <EOL> assert '<STR_LIT>' == deps [ <NUM_LIT:0> ] [ <NUM_LIT:2> ] <EOL> assert '<STR_LIT>' == deps [ <NUM_LIT:1> ] [ <NUM_LIT:2> ] <EOL> assert '<STR_LIT>' == deps [ <NUM_LIT:2> ] [ <NUM_LIT:2> ] <EOL> assert '<STR_LIT>' == deps [ <NUM_LIT:5> ] [ <NUM_LIT:2> ] <EOL> assert '<STR_LIT>' == deps [ <NUM_LIT:6> ] [ <NUM_LIT:2> ] <EOL> assert <NUM_LIT:5> == len ( list ( config . get_deps ( depth = <NUM_LIT:2> ) ) ) <EOL> assert <NUM_LIT:3> == len ( list ( config . get_deps ( depth = <NUM_LIT:1> ) ) ) <EOL> assert <NUM_LIT:0> == len ( list ( config . get_deps ( depth = <NUM_LIT:0> ) ) ) <EOL> @ pytest . mark . integration <EOL> def test_install_with_dirs ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert <NUM_LIT:2> == count <EOL> def test_install_with_dirs_unknown ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( '<STR_LIT>' ) <EOL> assert <NUM_LIT:0> == count <EOL> def test_install_with_depth_0 ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( depth = <NUM_LIT:0> ) <EOL> assert <NUM_LIT:0> == count <EOL> @ pytest . mark . integration <EOL> def test_install_with_depth_1 ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( depth = <NUM_LIT:1> ) <EOL> assert <NUM_LIT:3> == count <EOL> @ pytest . mark . integration <EOL> def test_install_with_depth_2 ( self ) : <EOL> """<STR_LIT>""" <EOL> config = Config ( FILES ) <EOL> count = config . install_deps ( depth = <NUM_LIT:2> ) <EOL> assert <NUM_LIT:5> == count <EOL> def describe_config ( ) : <EOL> @ pytest . fixture <EOL> def config ( ) : <EOL> return Config ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def describe_get_path ( ) : <EOL> def it_defaults_to_sources_location ( config ) : <EOL> expect ( config . get_path ( ) ) == "<STR_LIT>" <EOL> def it_can_get_the_config_path ( config ) : <EOL> expect ( config . get_path ( '<STR_LIT>' ) ) == "<STR_LIT>" <EOL> def it_can_get_log_path ( config ) : <EOL> expect ( config . get_path ( '<STR_LIT>' ) ) == "<STR_LIT>" <EOL> def it_can_get_dependency_path ( config ) : <EOL> expect ( config . get_path ( '<STR_LIT>' ) ) == "<STR_LIT>" <EOL> class TestLoad : <EOL> def test_load_from_directory_with_config_file ( self ) : <EOL> config = load_config ( FILES ) <EOL> assert None is not config <EOL> def test_load_from_directory_without_config_file ( self , tmpdir ) : <EOL> tmpdir . chdir ( ) <EOL> config = load_config ( ) <EOL> assert None is config </s>
