Skip to content

Commit d748929

Browse files
committed
Merge pull request #96 from jammons/master
Add Tox with linting and coverage for py 2.7, 3.4, 3.5 test running
2 parents e1a4a3c + 2590662 commit d748929

15 files changed

Lines changed: 77 additions & 14 deletions

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
.idea
44
dist
55
slackclient.egg-info
6+
*.log
7+
env
8+
.tox
9+
*.un~
10+
0/
11+
tests/.cache
12+
.coverage
13+
.cache

.travis.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
sudo: false
12
language: python
23
python:
3-
- "2.6"
4-
- "2.7"
5-
- "3.2"
6-
- "3.3"
7-
- "3.4"
84
- "3.5"
9-
install: "python setup.py install"
10-
script: py.test
5+
env:
6+
matrix:
7+
- TOX_ENV=py27
8+
- TOX_ENV=py34
9+
- TOX_ENV=py35
10+
- TOX_ENV=flake8
11+
cache: pip
12+
install:
13+
- "travis_retry pip install setuptools --upgrade"
14+
- "travis_retry pip install tox"
15+
script:
16+
- tox -e $TOX_ENV
17+
after_script:
18+
- cat .tox/$TOX_ENV/log/*.log

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ python-slackclient
22
================
33

44
[![Build Status](https://travis-ci.org/slackhq/python-slackclient.svg?branch=master)](https://travis-ci.org/slackhq/python-slackclient)
5+
[![Coverage Status](https://coveralls.io/repos/github/slackhq/python-slackclient/badge.svg?branch=master)](https://coveralls.io/github/slackhq/python-slackclient?branch=master)
56

67
A basic client for Slack.com, which can optionally connect to the Slack Real Time Messaging (RTM) API.
78

requirements-dev.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coveralls==1.1
2+
ipdb==0.9.3
3+
ipython==4.1.2
4+
pdbpp==0.8.3
5+
pytest>=2.8.2
6+
pytest-cov==2.2.1
7+
pytest-pythonpath>=0.3
8+
testfixtures==4.9.1
9+
tox>=1.8.0

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
future==0.15.2
2-
pytest==2.8.7
32
websocket-client==0.35.0

slackclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from slackclient._client import SlackClient
1+
from slackclient._client import SlackClient # noqa

slackclient/_client.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ def api_call(self, method, **kwargs):
2626
self.server.attach_channel(kwargs["user"], result["channel"]["id"])
2727
elif method in ('mpim.open', 'groups.create', 'groups.createchild'):
2828
if "ok" in result and result["ok"]:
29-
self.server.attach_channel(result['group']['name'], result['group']['id'], result['group']['members'])
29+
self.server.attach_channel(
30+
result['group']['name'],
31+
result['group']['id'],
32+
result['group']['members']
33+
)
3034
elif method in ('channels.create', 'channels.join'):
3135
if 'ok' in result and result['ok']:
32-
self.server.attach_channel(result['channel']['name'], result['channel']['id'], result['channel']['members'])
36+
self.server.attach_channel(
37+
result['channel']['name'],
38+
result['channel']['id'],
39+
result['channel']['members']
40+
)
3341
return result
3442

3543
def rtm_read(self):
File renamed without changes.

0 commit comments

Comments
 (0)