Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Manual Scrape Service testing:
- 1. Create a new file
- 2. Config the account, the proxy and the Service
- example: (import the missing files)
- username = AccountConstants.USERNAME_1
- password = AccountConstants.PASSWORD_1
- proxy = AccountConstants.PROXY_HOST
- config = AccountConfig.AccountConfig(username, password, proxy)
- api_util = ApiUtil(config)
- scrape_service = ScrapeService(api_util)
- csv_service = CSVService()
- 3. Choose a method form the service and call it
- scrape_service.get_tag_info("athleticwear")
- scrape_service.get_tag_info("fitnessfashion")
- scrape_service.get_tag_info("mytag")...
- 4.Print the data objects received from the cache
- for tag in scrape_service._cache_hashtags:
- print(scrape_service._cache_hashtags)
- pprint(vars(scrape_service._cache_hashtags[tag]))
- print("---------------------")
- Simple example:
- from pprint import pprint
- from services.CSVService import CSVService
- from services.ScrapeService import ScrapeService
- from services.utils import AccountConfig, AccountConstants
- from services.utils.ApiUtil import ApiUtil
- username = AccountConstants.USERNAME_1
- password = AccountConstants.PASSWORD_1
- proxy = AccountConstants.PROXY_HOST
- config = AccountConfig.AccountConfig(username, password, proxy)
- api_util = ApiUtil(config)
- scrape_service = ScrapeService(api_util)
- csv_service = CSVService()
- scrape_service.get_tag_info("athleticwear")
- scrape_service.get_tag_info("fitnessfashion")
- for tag in scrape_service._cache_hashtags:
- print(scrape_service._cache_hashtags)
- pprint(vars(scrape_service._cache_hashtags[tag]))
- The code is well covered with integration tests and works well, so there is no real need of manual testing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement