Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
salilmishra23 committed Nov 18, 2022
1 parent e3e23df commit f82782b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
.coverage
build
dist
.pytest_cache/
.vscode/
3 changes: 3 additions & 0 deletions mozdownload/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ def binary_regex(self):
'android-api-11': r'\.%(EXT)s$',
'android-api-15': r'\.%(EXT)s$',
'android-api-16': r'\.%(EXT)s$',
'android-arm64-v8a': r'\.%(EXT)s$',
'armeabi-v7a': r'\.%(EXT)s$',
'android-x86': r'\.%(EXT)s$',
'android-x86_64': r'\.%(EXT)s$',
'linux': r'\.%(EXT)s$',
'linux64': r'\.%(EXT)s$',
'mac': r'\.%(EXT)s$',
Expand Down
13 changes: 11 additions & 2 deletions tests/daily_scraper/test_daily_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,21 @@
]

fenix_tests = [
({'application': 'fenix', 'platform': 'android-x86', 'branch': '', 'date': '2022-11-14'},
({'application': 'fenix', 'platform': 'android-arm64-v8a', 'date': '2022-11-14'},
'fenix-108.0b1.multi.android-arm64-v8a.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk'),
({'application': 'fenix', 'platform': 'android-x86', 'date': '2022-11-14'},
'fenix-108.0b1.multi.android-x86.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86/fenix-108.0b1.multi.android-x86.apk'),
({'application': 'fenix', 'platform': 'android-arm64-v8a', 'date': '2022-11-14'},
'fenix-108.0b1.multi.android-arm64-v8a.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk'),
({'application': 'fenix', 'platform': 'android-x86_64', 'date': '2022-11-14'},
'fenix-108.0b1.multi.android-x86_64.apk',
'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk'),
]

@pytest.mark.parametrize("args,filename,url", fenix_tests)
@pytest.mark.parametrize("args,filename,url", firefox_tests + thunderbird_tests + fennec_tests + fenix_tests)
def test_scraper(httpd, tmpdir, args, filename, url):
"""Testing various download scenarios for DailyScraper"""

Expand Down

0 comments on commit f82782b

Please sign in to comment.