<s> """<STR_LIT>""" <EOL> import os <EOL> import yaml <EOL> from . . utils . common import in_temporary_directory <EOL> from . . utils . common import bloom_answer <EOL> from . . utils . common import user <EOL> from bloom . config import BLOOM_CONFIG_BRANCH <EOL> from bloom . git import branch_exists <EOL> from bloom . git import inbranch <EOL> @ in_temporary_directory <EOL> def test_create_a_bloom_repository ( directory = None ) : <EOL> """<STR_LIT>""" <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> with bloom_answer ( [ '<STR_LIT>' , '<STR_LIT:foo>' , '<STR_LIT>' ] ) : <EOL> r = user ( '<STR_LIT>' , return_io = True , silent = False ) <EOL> _ , out , err = r <EOL> assert out . count ( '<STR_LIT>' ) > <NUM_LIT:0> , "<STR_LIT>" + out + "<STR_LIT>" <EOL> assert branch_exists ( BLOOM_CONFIG_BRANCH ) , "<STR_LIT>" . format ( BLOOM_CONFIG_BRANCH ) <EOL> with inbranch ( BLOOM_CONFIG_BRANCH ) : <EOL> assert os . path . exists ( '<STR_LIT>' ) , "<STR_LIT>" <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as f : <EOL> tracks_dict = yaml . load ( f . read ( ) ) <EOL> assert '<STR_LIT>' in tracks_dict , "<STR_LIT>" <EOL> assert '<STR_LIT:foo>' in tracks_dict [ '<STR_LIT>' ] , "<STR_LIT>" <EOL> track = tracks_dict [ '<STR_LIT>' ] [ '<STR_LIT:foo>' ] <EOL> assert '<STR_LIT>' in track , "<STR_LIT>" <EOL> assert '<STR_LIT>' == track [ '<STR_LIT>' ] , "<STR_LIT>" + str ( track ) <EOL> with bloom_answer ( bloom_answer . ASSERT_NO_QUESTION ) : <EOL> user ( '<STR_LIT>' ) <EOL> @ in_temporary_directory <EOL> def test_call_config_outside_of_git_repo ( directory = None ) : <EOL> """<STR_LIT>""" <EOL> with bloom_answer ( bloom_answer . ASSERT_NO_QUESTION ) : <EOL> r = user ( '<STR_LIT>' , <EOL> auto_assert = False ) <EOL> assert r != <NUM_LIT:0> , "<STR_LIT>" + str ( r ) <EOL> def setup_git_repo ( directory = None ) : <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> user ( '<STR_LIT>' ) <EOL> @ in_temporary_directory <EOL> def test_call_config_with_local_changes ( directory = None ) : <EOL> """<STR_LIT>""" <EOL> setup_git_repo ( directory ) <EOL> user ( '<STR_LIT>' ) <EOL> with bloom_answer ( bloom_answer . ASSERT_NO_QUESTION ) : <EOL> r = user ( '<STR_LIT>' , <EOL> auto_assert = False ) <EOL> assert r != <NUM_LIT:0> , "<STR_LIT>" + str ( r ) <EOL> @ in_temporary_directory <EOL> def test_call_config_with_untracked_files ( directory = None ) : <EOL> """<STR_LIT>""" <EOL> setup_git_repo ( directory ) <EOL> user ( '<STR_LIT>' ) <EOL> with bloom_answer ( bloom_answer . ASSERT_NO_QUESTION ) : <EOL> r = user ( '<STR_LIT>' , <EOL> auto_assert = False ) <EOL> assert r != <NUM_LIT:0> , "<STR_LIT>" + str ( r ) </s>
