-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use empty string to indicate unrecognized scheme
Signed-off-by: Martin Styk <[email protected]>
- Loading branch information
1 parent
1308016
commit 3b14e3e
Showing
2 changed files
with
28 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright Contributors to the Beaker project. | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
import unittest | ||
|
||
from bkr.server.distrotrees import DistroTrees | ||
|
||
|
||
class CheckDistroTreeImportUnitTest(unittest.TestCase): | ||
|
||
def test_undefined_schema_in_url(self): | ||
t_url = [ | ||
"https://example.com/RHEL11-Server/x86_64/os", | ||
"example.com/RHEL11-Server/x86_64/ppc64", | ||
"example.com/RHEL11-Server/x86_64/aarch64" | ||
] | ||
t_distro_tree, t_lab_controller = None, None | ||
|
||
with self.assertRaises(ValueError) as context: | ||
DistroTrees.add_distro_urls(t_distro_tree, t_lab_controller, t_url) | ||
|
||
self.assertTrue('URL {} is not absolute'.format(t_url[2]) in context.exception) |