-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathutil_test.py
More file actions
28 lines (22 loc) · 927 Bytes
/
util_test.py
File metadata and controls
28 lines (22 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from itunes_app_scraper.util import AppStoreException, AppStoreCollections, AppStoreCategories, AppStoreUtils
import json
import pytest
import os
def test_category_exists():
category = AppStoreCategories()
assert category.BOOKS == 6018
def test_category_does_not_exist():
category = AppStoreCategories()
with pytest.raises(AttributeError, match="'AppStoreCategories' object has no attribute 'METHOD'"):
category.METHOD
def test_collection_exists():
collection = AppStoreCollections()
assert collection.TOP_FREE_IOS == 'freeAppsV2'
def test_collection_does_not_exist():
collection = AppStoreCollections()
with pytest.raises(AttributeError, match="'AppStoreCollections' object has no attribute 'NOTHING'"):
collection.NOTHING
def test_app_utils():
utils = AppStoreUtils()
collections = utils.get_entries(AppStoreCollections())
assert "TOP_FREE_IOS" in collections