Skip to content

Commit 7cc55c6

Browse files
committed
Adding instructions to run test suite.
1 parent d767e75 commit 7cc55c6

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,24 @@ When in Databox Designer go to Account > Access tokens, then either create a new
1212

1313
## Using the Databox Python library
1414

15-
from databox import PushClient
16-
17-
# instantiate PushClient
18-
client = PushClient('<access token>')
19-
20-
# push metric "answer1" with value 42 for today
21-
client.add(42, "answer1")
22-
23-
# push metric "answer1" with value 42 for any other day
24-
client.add(42, "answer1", "2015-05-01 10:10:10")
25-
26-
# send to Databox
27-
print client.send()
28-
29-
# get last push
30-
print client.lastPush()
15+
```python
16+
from databox import PushClient
3117

18+
# instantiate PushClient
19+
client = PushClient('<access token>')
20+
21+
# push metric "answer1" with value 42 for today
22+
client.add(42, "answer1")
23+
24+
# push metric "answer1" with value 42 for any other day
25+
client.add(42, "answer1", "2015-05-01 10:10:10")
26+
27+
# send to Databox
28+
print client.send()
29+
30+
# get last push
31+
print client.lastPush()
32+
``
3233

3334
Check working sample in [sample1.py](/sample1.py) file.
3435

@@ -37,6 +38,9 @@ Check working sample in [sample1.py](/sample1.py) file.
3738
mkvirtualenv --no-site-packages databox-python
3839
workon databox-python
3940
pip install --upgrade -r requirements.txt
41+
42+
# Running test suite
43+
python -munittest discover -p -t . 'test*' -v
4044

4145
## Authors and contributions
4246

databox/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def __init__(self, token=None):
2222
if self._token is None and token is not None:
2323
self._token = token
2424

25-
2625
def push(self, key, value, date=None):
2726
print "--- push --- ", self.token
2827
pass

0 commit comments

Comments
 (0)