Skip to content

Commit

Permalink
Initial testing stubs and POC for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
dstegelman committed Jul 9, 2016
1 parent a034e76 commit b1c58b6
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 6 deletions.
92 changes: 89 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
.idea
build
dist
*.egg-info
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: python

python:
- "2.7"
- "3.4"

# command to install dependencies
install:
- pip install -r requirements.txt

# command to run tests

script:
- py.test tests rocketchat -x
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ Python API wrapper for the [Rocket chat API](https://rocket.chat/docs/developer-
Initialize the client with a username and password. This user *must* have Admin privs::

from rocketchat.api import RocketChatAPI

api = RocketChatAPI(settings={'username': 'someuser', 'password': 'somepassword',
'domain': 'https://myrockethchatdomain.com'})

#### Supported Calls

Only a few calls exist within the API, and I am only adding them as they are needed by
Only a few calls exist within the API, and I am only adding them as they are needed by
users. If you need a call, open an issue or send a pull request.

#### Running Tests

py.test tests

##### Sending a message

You'll first need to get the _id of the room you want to send a message to. Currently, Rocket
can only send messages to *public* rooms.

api.send_message('Your message', room_id)

15 changes: 15 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[pytest]
addopts =
--flakes
--pep8

python_files = *.py

pep8maxlinelength = 100
pep8ignore =
tests/data.py ALL
docs/conf.py ALL
conftest.py ALL
tests/test_api.py ALL
kstate/calls/rave/mixins.py E501
kstate/calls/rave/update_rave_user.py E501
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
requests>=2.0.0,<3.0
pytest==2.8.7
pytest-flakes==1.0.1
pytest-sugar
pytest-pep8==1.0.6
mock==1.0.1
7 changes: 7 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import unittest


class APITestCase(unittest.TestCase):

def test_send_message(self):
self.fail()

0 comments on commit b1c58b6

Please sign in to comment.