Skip to content

Commit a3c383e

Browse files
committed
Merge pull request influxdata#131 from savoirfairelinux/build_and_install_server
Add a test module against a real running server (Thanks @gst!)
2 parents 528275d + b00409a commit a3c383e

File tree

9 files changed

+792
-2
lines changed

9 files changed

+792
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
install:
1313
- sudo pip install tox
1414
- sudo pip install coveralls
15+
- ./build_influxdb_server.sh
1516
script:
1617
- travis_wait tox -e $TOX_ENV
1718
after_success:

build_influxdb_server.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# build and install,
5+
# the latest influxdb server master
6+
#
7+
8+
set -e
9+
10+
tmpdir=$(mktemp -d)
11+
12+
echo "Using tempdir $tmpdir .."
13+
14+
cd "$tmpdir"
15+
16+
# rpm for package.sh (below) which will also build an .rpm
17+
sudo apt-get install ruby ruby-dev build-essential rpm
18+
19+
echo $PATH
20+
echo $(which gem)
21+
echo $(which ruby)
22+
23+
gem=$(which gem)
24+
25+
sudo $gem install fpm
26+
27+
mkdir -p go/src/github.com/influxdb
28+
cd go/src/github.com/influxdb
29+
30+
git clone --depth 5 https://github.com/influxdb/influxdb
31+
cd influxdb
32+
33+
version=0.0.0-$(git describe --always | sed 's/^v//')
34+
echo "describe: $version"
35+
36+
export GOPATH="$tmpdir/go"
37+
{ echo y ; yes no ; } | ./package.sh "$version"
38+
39+
deb=$(ls *.deb)
40+
sudo dpkg -i "$deb"

influxdb/_dataframe_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def write_points_with_precision(self, data, time_precision='s'):
6868
FutureWarning)
6969
return self.write_points(data, time_precision='s')
7070

71-
def query(self, query, time_precision='s', chunked=False):
71+
def query(self, query, time_precision='s', chunked=False, database=None):
7272
"""
7373
Quering data into a DataFrame.
7474

influxdb/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
class InfluxDBClientError(Exception):
2020
"""Raised when an error occurs in the request"""
2121
def __init__(self, content, code):
22+
if isinstance(content, type(b'')):
23+
content = content.decode('UTF-8', errors='replace')
2224
super(InfluxDBClientError, self).__init__(
2325
"{0}: {1}".format(code, content))
2426
self.content = content

tests/influxdb/client_test.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
unit tests
3+
unit tests for the InfluxDBClient.
4+
5+
NB/WARNING :
6+
This module implements tests for the InfluxDBClient class
7+
but does so
8+
+ without any server instance running
9+
+ by mocking all the expected responses.
10+
11+
So any change of (response format from) the server will **NOT** be
12+
detected by this module.
13+
14+
See client_test_with_server.py for tests against a running server instance.
15+
416
"""
517
import json
618
import requests

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy