How to use the portray.config.repository function in portray

To help you get started, we’ve selected a few portray examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timothycrosley / portray / tests / test_config.py View on Github external
def test_repository_no_config_no_repository(temporary_dir):
    assert config.repository(temporary_dir) == {}
github timothycrosley / portray / tests / test_config.py View on Github external
project_dir, repo_url="https://bitbucket.org/atlassian/stash-example-plugin.git"
    ) == {
        "edit_uri": "src/default/docs/",
        "repo_name": "stash-example-plugin",
        "repo_url": "https://bitbucket.org/atlassian/stash-example-plugin",
    }

    assert config.repository(
        project_dir, repo_url="git@bitbucket.org:atlassian/stash-example-plugin.git"
    ) == {
        "edit_uri": "src/default/docs/",
        "repo_name": "stash-example-plugin",
        "repo_url": "https://bitbucket.org/atlassian/stash-example-plugin",
    }

    assert config.repository(project_dir, repo_url="not_actually_a_valid_url") == {
        "repo_name": "not_actually_a_valid_url",
        "repo_url": "not_actually_a_valid_url",
    }

    assert config.repository(
        project_dir, repo_url="https://gitlab.ci.token:password@gitlab.net/app.git"
    ) == {"edit_uri": "edit/master/", "repo_name": "app", "repo_url": "https://gitlab.net/app"}
github timothycrosley / portray / tests / test_config.py View on Github external
def test_repository_custom_config(project_dir):
    assert config.repository(project_dir) == {
        "edit_uri": "edit/master/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, repo_name="different_name") == {
        "edit_uri": "edit/master/",
        "repo_name": "different_name",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, edit_uri="edit/develop/") == {
        "edit_uri": "edit/develop/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }
github timothycrosley / portray / tests / test_config.py View on Github external
}

    assert config.repository(
        project_dir, repo_url="git@bitbucket.org:atlassian/stash-example-plugin.git"
    ) == {
        "edit_uri": "src/default/docs/",
        "repo_name": "stash-example-plugin",
        "repo_url": "https://bitbucket.org/atlassian/stash-example-plugin",
    }

    assert config.repository(project_dir, repo_url="not_actually_a_valid_url") == {
        "repo_name": "not_actually_a_valid_url",
        "repo_url": "not_actually_a_valid_url",
    }

    assert config.repository(
        project_dir, repo_url="https://gitlab.ci.token:password@gitlab.net/app.git"
    ) == {"edit_uri": "edit/master/", "repo_name": "app", "repo_url": "https://gitlab.net/app"}
github timothycrosley / portray / tests / test_config.py View on Github external
def test_repository_custom_config(project_dir):
    assert config.repository(project_dir) == {
        "edit_uri": "edit/master/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, repo_name="different_name") == {
        "edit_uri": "edit/master/",
        "repo_name": "different_name",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, edit_uri="edit/develop/") == {
        "edit_uri": "edit/develop/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(
        project_dir, repo_url="https://github.com/timothycrosley/examples"
    ) == {
        "edit_uri": "edit/master/",
        "repo_name": "examples",
        "repo_url": "https://github.com/timothycrosley/examples",
    }

    assert config.repository(
        project_dir, repo_url="https://bitbucket.org/atlassian/stash-example-plugin.git"
    ) == {
github timothycrosley / portray / tests / test_config.py View on Github external
def test_repository_custom_config(project_dir):
    assert config.repository(project_dir) == {
        "edit_uri": "edit/master/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, repo_name="different_name") == {
        "edit_uri": "edit/master/",
        "repo_name": "different_name",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(project_dir, edit_uri="edit/develop/") == {
        "edit_uri": "edit/develop/",
        "repo_name": "portray",
        "repo_url": "https://github.com/timothycrosley/portray",
    }

    assert config.repository(
        project_dir, repo_url="https://github.com/timothycrosley/examples"
    ) == {
        "edit_uri": "edit/master/",
        "repo_name": "examples",