Chromium Code Reviews

Side by Side Diff: recipe_modules/url/tests/validate_url.py

Issue 2868333004: Add URL recipe module from "depot_tools". (Closed)
Patch Set: fix/texst urllib methods, remove non_step Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 # Copyright 2017 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file.
4
5 DEPS = [
6 'properties',
7 'step',
8 'url',
9 ]
10
11
12 def RunSteps(api):
13 api.url.validate_url(api.properties['url_to_validate'])
14
15
16 def GenTests(api):
17 yield (api.test('basic') +
18 api.properties(url_to_validate='https://example.com'))
19
20 yield (api.test('no_scheme') +
21 api.properties(url_to_validate='example.com') +
22 api.expect_exception('ValueError'))
23
24 yield (api.test('invalid_scheme') +
25 api.properties(url_to_validate='ftp://example.com') +
26 api.expect_exception('ValueError'))
27
28 yield (api.test('no_host') +
29 api.properties(url_to_validate='https://') +
30 api.expect_exception('ValueError'))
OLDNEW

Powered by Google App Engine