Example #1
0
    def test_no_heroku_options(self):

        folder = os.path.join(self.folder, self.repo_name,
                              self.get_git_folder())

        result = find_heroku_sources(folder)
        self.assertEqual(len(result), 1)
Example #2
0
    def test_no_heroku_options(self):

        folder = os.path.join(
            self.folder,
            self.repo_name,
            self.get_git_folder()
        )

        result = find_heroku_sources(folder)
        self.assertEqual(len(result), 1)
Example #3
0
def add(valid_token=None):
    term = get_term()
    if not valid_token:
        raise ValueError("A valid token is required!")

    project_id = get_value(VALUE_PROJECT_ID, print_warnings=False)
    if not project_id:
        puts(
            term.red("Error: ") +
            "No application found. Please create or link an application first")
        return

    options = git.find_heroku_sources(os.curdir)

    if len(options) == 0:
        puts(term.red("Error: ") + "No heroku remotes found")
    elif len(options) == 1:
        _add_heroku_by_git(valid_token, project_id, options[0].url)
Example #4
0
def add(valid_token=None):
    term = get_term()
    if not valid_token:
        raise ValueError("A valid token is required!")

    project_id = get_value(VALUE_PROJECT_ID, print_warnings=False)
    if not project_id:
        puts(
            term.red("Error: ") +
            "No application found. Please create or link an application first"
        )
        return

    options = git.find_heroku_sources(os.curdir)

    if len(options) == 0:
        puts(term.red("Error: ") + "No heroku remotes found")
    elif len(options) == 1:
        _add_heroku_by_git(valid_token, project_id, options[0].url)