Skip to content

Commit

Permalink
Added Travis CI support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kandeel4411 committed Oct 31, 2019
1 parent 499d906 commit a577583
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: python
python:
- 3.7
install:
- pip install -r requirements.txt
script:
- pytest
15 changes: 12 additions & 3 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import configparser
import os
from pathlib import Path

import praw
Expand All @@ -7,9 +8,17 @@
import bot

# Getting bot credentials
config = configparser.RawConfigParser()
config.read("etc/config.ini")
login_config = config["Login"]
if os.getenv("REDDIT_CLIENT_ID") is None:
config = configparser.RawConfigParser()
config.read("etc/config.ini")
login_config = config["Login"]
else:
# For Travis testing
login_config = {
"client_id": os.getenv("REDDIT_CLIENT_ID"),
"client_secret": os.getenv("REDDIT_CLIENT_SECRET"),
"user_agent": os.getenv("REDDIT_USER_AGENT")
}

# Turning on bot exception
bot.raise_bot_exception(option=True)
Expand Down

0 comments on commit a577583

Please sign in to comment.