Skip to content

Commit 8858a9b

Browse files
committed
tests, example, changelog
1 parent c901688 commit 8858a9b

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
Following guidelines of http://keepachangelog.com/
33

44
## [Unreleased]
5-
- update to support Databox API version 3
5+
6+
## [2.0.0] - Aug 19, 2016
7+
- implement `GET /metrickeys`
8+
- update `GET /lastpushes`
9+
- implement `DELETE /data`
10+
- update `user-agent` and `Accept` request headers
11+
- update README
612

713
## [0.1.6] - Jan 24, 2016
814
- Changes related to last_push
@@ -28,7 +34,8 @@ Following guidelines of http://keepachangelog.com/
2834
## [0.1] - May 20, 2015
2935
- Initial release
3036

31-
[Unreleased]: https://github.com/databox/databox-go/compare/0.1.6...master
37+
[Unreleased]: https://github.com/databox/databox-go/compare/2.0.0...master
38+
[2.0.0]: https://github.com/databox/databox-python/compare/0.1.6...2.0.0
3239
[0.1.6]: https://github.com/databox/databox-python/compare/0.1.5...0.1.6
3340
[0.1.5]: https://github.com/databox/databox-python/compare/0.1.4...0.1.5
3441
[0.1.4]: https://github.com/databox/databox-python/compare/0.1.1...0.1.4

databox test/test_push.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def mock_push_json(data=None, path='/'):
8-
return {'status': 'ok'}
8+
return {'id': '2837643'}
99

1010

1111
class TestPush(unittest.TestCase):
@@ -68,7 +68,7 @@ def test_last_push(self):
6868

6969
def test_last_push_with_number(self):
7070
self.client._get_json = lambda data=None, path='/': path
71-
assert self.client.last_push(3) == '/lastpushes/3'
71+
assert self.client.last_push(3) == '/lastpushes?limit=3'
7272

7373

7474
def test_short(self):

example.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
from databox import Client
1414

1515
client = Client(TOKEN)
16-
# client.push('sales.total', 1447.0)
17-
#client.push('orders.total', 32, date='2015-01-01 09:00:00')
16+
17+
# client.push('orders.total', 32, date='2015-01-01 09:00:00')
1818

1919
# key = 'temp.ljx'
2020
# rows = []
@@ -28,16 +28,22 @@
2828
#
2929
#
3030

31+
push = client.push('transaction', 1447.4)
32+
3133
print client.insert_all([
3234
{'key': 'temp.boston', 'value': 51},
3335
{'key': 'temp.boston', 'value': 49, 'date': '2015-01-01 17:00:00'},
3436
{'key': 'sales.total', 'value': 3000, 'attributes': {
3537
'name': "Oto",
3638
'price': 199
3739
}},
40+
{'key': 'transaction', 'value': 45.6, 'unit': 'USD'}
3841
])
3942

4043
print "--------"
4144

42-
print client.last_push(3)
45+
lastPushes = client.last_push(3)
4346

47+
print client.get_push(lastPushes[0]['response']['body']['id'])
48+
print client.metrics()
49+
print client.purge()

0 commit comments

Comments
 (0)