-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9728abb
commit de1e407
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -450,11 +450,18 @@ def test_repo_url_starts_with_git_when_using_ssh_conn_id(self, mock_hook, repo_u | |
], | ||
) | ||
@mock.patch("airflow.dag_processing.bundles.git.Repo") | ||
def test_view_url(self, mock_gitrepo, repo_url, expected_url): | ||
def test_view_url(self, mock_gitrepo, repo_url, expected_url, session): | ||
session.query(Connection).delete() | ||
conn = Connection( | ||
conn_id="git_default", | ||
host=repo_url, | ||
conn_type="git", | ||
) | ||
session.add(conn) | ||
session.commit() | ||
bundle = GitDagBundle( | ||
name="test", | ||
refresh_interval=300, | ||
repo_url=repo_url, | ||
tracking_ref="main", | ||
) | ||
view_url = bundle.view_url("0f0f0f") | ||
|
@@ -465,7 +472,6 @@ def test_view_url_returns_none_when_no_version_in_view_url(self, mock_gitrepo): | |
bundle = GitDagBundle( | ||
name="test", | ||
refresh_interval=300, | ||
repo_url="[email protected]:apache/airflow.git", | ||
tracking_ref="main", | ||
) | ||
view_url = bundle.view_url(None) | ||
|