Skip to content

Commit

Permalink
Unittests: Add support for pypi provider
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Nov 10, 2023
1 parent 7e1cd97 commit 7a1e586
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,19 @@ def setUpClass(cls):
rel_b_reg = r'''^ ( https:// bitbucket\.org / [^/#?]+ / [^/#?]+
| https:// github\.com / [^/#?]+ / [^/#?]+
| https:// gitlab\.com / [^/#?]+ / [^/#?]+
| https:// pypi\.org / project / [^/#?]+ (?:/ [^/#?]+ )?
) $'''
# Strip multilines for better debug info on failures
rel_b_reg = ' '.join(map(str.strip, rel_b_reg.split()))
release_base_regex = re.compile(rel_b_reg, re.X)
library_release_base_regex = re.compile(rel_b_reg, re.X)

rel_b_reg = r'''^ ( https:// bitbucket\.org / [^/#?]+ / [^/#?]+
| https:// github\.com / [^/#?]+ / [^/#?]+
| https:// gitlab\.com / [^/#?]+ / [^/#?]+
) $'''
# Strip multilines for better debug info on failures
rel_b_reg = ' '.join(map(str.strip, rel_b_reg.split()))
package_release_base_regex = re.compile(rel_b_reg, re.X)

pac_d_reg = r'''^ ( https:// bitbucket\.org/ [^/#?]+/ [^/#?]+
( /src/ [^#?]*[^/#?] | \#tags | / )?
Expand Down Expand Up @@ -492,7 +501,8 @@ def check_release_key_values(self, data, library):
self.assertRegex(v, r'^https?://')

elif k == 'base':
self.assertRegex(v, self.release_base_regex,
pattern = self.library_release_base_regex if library else self.package_release_base_regex
self.assertRegex(v, pattern,
'The base url is badly formatted or '
'invalid')

Expand Down

0 comments on commit 7a1e586

Please sign in to comment.