Added testing code, bumped version

This commit is contained in:
Frisk 2019-02-13 10:12:18 +01:00
parent 0a03f27526
commit 06ccfea1cd
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C
4 changed files with 14 additions and 3 deletions

View file

@ -7,6 +7,6 @@ test:
- pip3.6 install -r requirements.txt
- sed -i -e 's/https:\/\/discordapp.com\/api\/webhooks\/111111111111111111\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/$DISCORD/g' settings.json.example
- mv settings.json.example settings.json
- python3.6 rcgcdw.py
- python3.6 rcgcdw.py --test
only:
- testing

View file

@ -30,6 +30,8 @@ if __name__ != "__main__":
logging.critical("The file is being executed as a module. Please execute the script using the console.")
sys.exit(1)
TESTING = True if "--test" in sys.argv else False
try:
with open("settings.json") as sfile:
settings = json.load(sfile)
@ -1153,6 +1155,15 @@ if settings["overview"]:
logging.error("Invalid time format! Currentely: {}. Note: It needs to be in HH:MM format.".format(settings["overview_time"]))
schedule.every().day.at("00:00").do(recent_changes.clear_cache)
if TESTING:
logging.debug("DEBUGGING")
recent_changes.recent_id -= 5
recent_changes.file_id -= 5
recent_changes.ids = [1]
recent_changes.fetch(amount=5)
day_overview()
sys.exit(0)
while 1:
time.sleep(1.0)
schedule.run_pending()

View file

@ -3,7 +3,7 @@
"wiki": "minecraft",
"lang": "en",
"header": {
"user-agent": "FrisksRcGcDw/1.5.1.2"
"user-agent": "FrisksRcGcDw/1.5.2"
},
"limit": 11,
"webhookURL": "https://discordapp.com/api/webhooks/111111111111111111/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

View file

@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='RcGcDw',
version='1.5.1.2',
version='1.5.2',
packages=['venv.lib.python3.7.site-packages.bs4', 'venv.lib.python3.7.site-packages.bs4.tests',
'venv.lib.python3.7.site-packages.bs4.builder', 'venv.lib.python3.7.site-packages.idna',
'venv.lib.python3.7.site-packages.lxml', 'venv.lib.python3.7.site-packages.lxml.html',