示例#1
0
def get_travis_files_content(full_name, github_token, config):
    """ Return the content of the files that will be committed to the repo. """

    info         = {
        'GIT_NAME': GIT_NAME,
        'GIT_EMAIL': GIT_EMAIL,
        'GH_TOKEN': github_token
    }

    user_pages   = github_utils.is_user_pages(full_name)

    travis_files = [
        {
            'name': SCRIPT,
            'content': travis_utils.get_script_contents(SCRIPT, config),
            'message': (
                'Add build and deploy script (via Statiki).\n\n[skip ci]'
            ),
        },
        {
            'name': '.travis.yml',
            'content': travis_utils.get_yaml_contents(
                full_name, SCRIPT, info, user_pages
            ),
            'message': 'Add .travis.yml (via Statiki).',
        },
    ]

    return travis_files
示例#2
0
    def test_should_get_script_contents(self):
        # Given
        config = {'BLOG_TITLE': 'foo'}

        # When
        content = travis_utils.get_script_contents('travis_fabfile.py', config)

        # Then
        self.assertIn('BLOG_TITLE', content)