Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMingyu committed Jan 20, 2021
1 parent 291b769 commit d9ee67e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 6 additions & 3 deletions tests/e2e_tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from pprint import pprint
from unittest import TestCase

from google_play_scraper.features.app import app
Expand Down Expand Up @@ -130,10 +129,12 @@ def test_e2e_scenario_4(self):
"""
Testing for free, price that excluded from scenario 1~4
"""
res = app("com.choco.silentmode")
res = app("com.simplemobiletools.gallery.pro")

self.assertFalse(res["free"])
self.assertEqual(1.49, res["price"])
self.assertEqual(1.09, res["price"])

# TODO free app / non free app 구분

def test_e2e_scenario_5(self):
"""
Expand All @@ -146,6 +147,8 @@ def test_e2e_scenario_5(self):
self.assertFalse(res["offersIAP"])
self.assertFalse(res["inAppProductPrice"])

# TODO IAP, inAppProductPrice가 유효한 값인 경우에 대한 테스트

def test_e2e_scenario_6(self):
"""
Testing for editorsChoice property
Expand Down
9 changes: 4 additions & 5 deletions tests/e2e_tests/test_reviews.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timedelta
from unittest import TestCase
from unittest.mock import patch
from urllib.parse import urlparse
Expand Down Expand Up @@ -30,8 +30,8 @@ def test_sort_by_newest(self):
self.assertTrue(r["content"])
self.assertTrue(r["score"] >= 1)
self.assertTrue(r["thumbsUpCount"] >= 0)
self.assertTrue(datetime(2019, 12, 1) < r["at"] < datetime(2021, 1, 1))
# TODO change when 2020-12-30

self.assertTrue(datetime.now() - timedelta(days=7) < r['at'] < datetime.now())

if r["reviewCreatedVersion"]:
review_created_version_contained_review_count += 1
Expand Down Expand Up @@ -113,9 +113,8 @@ def test_reply_data(self):
self.assertTrue(len(reply_content) > 100)
self.assertIsInstance(replied_at, datetime)
self.assertTrue(
datetime(2018, 1, 1) < replied_at < datetime(2021, 1, 1)
datetime(2018, 6, 1) < replied_at < datetime(2022, 1, 1)
)
# TODO change when 2020-12-30

review_count_has_reply += 1

Expand Down

0 comments on commit d9ee67e

Please sign in to comment.