@in_temporary_directory
def test_create_a_bloom_repository(directory=None):
    """
    Create a Bloom Repository:
        User creates a new release repository, and calls git-bloom-config new.

    actions:
        - user creates a folder
        - user calls 'git init .' in that folder
        - user calls 'git-bloom-config new <track name>'

    expects:
        - bloom to ask the user if initialization is desired
        - bloom prompts the user for input on the settings
        - bloom branch to be created
        - tracks.yaml to be in bloom branch with appropriate contents
    """
    # Setup
    user('mkdir new_repo')
    user('cd new_repo')
    user('git init .')
    # Test bloom command
    with bloom_answer(['', 'foo', 'https://github.com/bar/foo.git']):
        r = user('git-bloom-config new foo', return_io=True, silent=False)
        _, out, err = r
    assert out.count('ontinue') > 0, \
        "git-bloom-config didn't ask about git init:\n```\n" + out + "\n```"
    assert branch_exists(BLOOM_CONFIG_BRANCH), \
        "branch '{0}' does not exist".format(BLOOM_CONFIG_BRANCH)
    with inbranch(BLOOM_CONFIG_BRANCH):
        assert os.path.exists('tracks.yaml'), \
            "no tracks.yaml file in the 'bloom' branch"
        with open('tracks.yaml', 'r') as f:
            tracks_dict = yaml.load(f.read())
        assert 'tracks' in tracks_dict, "bad bloom configurations"
        assert 'foo' in tracks_dict['tracks'], "bad bloom configurations"
        track = tracks_dict['tracks']['foo']
        assert 'vcs_uri' in track, "bad bloom configurations"
        assert 'https://github.com/bar/foo.git' == track['vcs_uri'], \
            "bad bloom configurations" + str(track)
    # Assert no question on the second attempt
    with bloom_answer(bloom_answer.ASSERT_NO_QUESTION):
        user('git-bloom-config')
dataset/ETHPy150Open ros-infrastructure/bloom/test/system_tests/test_bloom_setup.py/test_create_a_bloom_repository/original