[1bd6b5]: / tests / test_repository_detection.py

Download this file

13 lines (8 with data), 677 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from repository_detection import all_platforms as platforms
def test_link_detection():
from re import findall
assert findall(platforms['zenodo'], 'https://doi.org/10.5281/zenodo.3548040') == ['zenodo.3548040']
assert findall(platforms['zenodo'], '(https://doi.org/10.5281/zenodo.3548040).') == ['zenodo.3548040']
assert findall(platforms['bioconductor'], 'http://bioconductor.org/packages/CancerSubtypes/') == ['CancerSubtypes/']
assert findall(platforms['cran'], 'https://cran.r-project.org/package=LUCIDus') == ['LUCIDus']
assert findall(platforms['cran'], 'https://cran.r-project.org/web/packages/Spectrum/index.html') == ['Spectrum/index.html']