Skip to content

Commit feaec18

Browse files
Fix most tests
1 parent 7f51b61 commit feaec18

File tree

7 files changed

+19
-31
lines changed

7 files changed

+19
-31
lines changed

README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to install the Python client, you only need to use [`pip`](https://pack
2222
**IMPORTANT:** Currently we only support Python 2.7
2323

2424
```bash
25-
pip install pyslicer --extra-insert-url=https://packagecloud.io/slicingdice/clients/pypi/simple
25+
pip install pyslicer --extra-index-url=https://packagecloud.io/slicingdice/clients/pypi/simple
2626
```
2727

2828
## Usage
@@ -40,7 +40,7 @@ from pyslicer import SlicingDice
4040
# Configure the client
4141
client = SlicingDice(master_key='API_KEY', uses_test_endpoint=False)
4242

43-
# insertion data
43+
# Inserting data
4444
insert_data = {
4545
"user1@slicingdice.com": {
4646
"age": 22
@@ -100,22 +100,10 @@ print client.get_database()
100100

101101
```json
102102
{
103-
"active": [
104-
{
105-
"name": "Database 1",
106-
"description": "My first database",
107-
"data-expiration": 30,
108-
"created-at": "2016-04-05T10:20:30Z"
109-
}
110-
],
111-
"inactive": [
112-
{
113-
"name": "Database 2",
114-
"description": "My second database",
115-
"data-expiration": 90,
116-
"created-at": "2016-04-05T10:20:30Z"
117-
}
118-
]
103+
"name": "Database 1",
104+
"description": "My first database",
105+
"data-expiration": 30,
106+
"created-at": "2016-04-05T10:20:30Z"
119107
}
120108
```
121109

pyslicer/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ def create_column(self, data):
168168
format.
169169
"""
170170
base_url = self._wrapper_test()
171-
sd_data = validators.columnValidator(data)
171+
sd_data = validators.ColumnValidator(data)
172172
if sd_data.validator():
173-
url = base_url + URLResources.column
173+
url = base_url + URLResources.COLUMN
174174
return self._make_request(
175175
url=url,
176176
req_type="post",
@@ -180,7 +180,7 @@ def create_column(self, data):
180180
def get_columns(self):
181181
"""Get a list of columns"""
182182
base_url = self._wrapper_test()
183-
url = base_url + URLResources.column
183+
url = base_url + URLResources.COLUMN
184184
return self._make_request(
185185
url=url,
186186
req_type="get",

pyslicer/core/helper_handler_exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@
8282
82: exceptions.QueryMissingTypeParamException,
8383
83: exceptions.QueryInvalidOperatorException,
8484
84: exceptions.QueryIncorrectOperatorUsageException,
85-
85: exceptions.QuerycolumnNotActiveException,
85+
85: exceptions.QueryColumnNotActiveException,
8686
86: exceptions.QueryMissingOperatorException,
8787
87: exceptions.QueryIncompleteException,
8888
88: exceptions.QueryEventCountQueryException,
8989
89: exceptions.QueryInvalidMetricException,
9090
90: exceptions.QueryIntegerException,
91-
91: exceptions.QuerycolumnLimitException,
91+
91: exceptions.QueryColumnLimitException,
9292
92: exceptions.QueryLevelLimitException,
9393
93: exceptions.QueryBadAggsFormationException,
9494
94: exceptions.QueryInvalidAggFilterException,

pyslicer/exceptions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ def __init__(self, *args, **kwargs):
425425
self, *args, **kwargs)
426426

427427

428-
class QuerycolumnNotActiveException(SlicingDiceException):
428+
class QueryColumnNotActiveException(SlicingDiceException):
429429
def __init__(self, *args, **kwargs):
430-
super(QuerycolumnNotActiveException, self).__init__(
430+
super(QueryColumnNotActiveException, self).__init__(
431431
self, *args, **kwargs)
432432

433433

@@ -461,9 +461,9 @@ def __init__(self, *args, **kwargs):
461461
self, *args, **kwargs)
462462

463463

464-
class QuerycolumnLimitException(SlicingDiceException):
464+
class QueryColumnLimitException(SlicingDiceException):
465465
def __init__(self, *args, **kwargs):
466-
super(QuerycolumnLimitException, self).__init__(
466+
super(QueryColumnLimitException, self).__init__(
467467
self, *args, **kwargs)
468468

469469

pyslicer/url_resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class URLResources(object):
66
DATABASE = "/database/"
7-
column = "/column/"
7+
COLUMN = "/column/"
88
INSERT = "/insert/"
99
QUERY_COUNT_ENTITY = "/query/count/entity/"
1010
QUERY_COUNT_ENTITY_TOTAL = "/query/count/entity/total/"

pyslicer/utils/validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def validator(self):
259259
return True
260260

261261

262-
class columnValidator(SDBaseValidator):
262+
class ColumnValidator(SDBaseValidator):
263263
def __init__(self, data_column):
264264
"""
265265
Parameters:
@@ -268,7 +268,7 @@ def __init__(self, data_column):
268268
if not isinstance(data_column, list):
269269
data_column = [data_column]
270270
for dictionary_column in data_column:
271-
super(columnValidator, self).__init__(dictionary_column)
271+
super(ColumnValidator, self).__init__(dictionary_column)
272272
self._valid_type_columns = [
273273
"unique-id", "boolean", "string", "integer", "decimal",
274274
"enumerated", "date", "integer-time-series",

tests_and_examples/run_query_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def run_tests(self, query_type):
7575

7676
print ' Query type: {}'.format(query_type)
7777

78-
auto_create = test['insert'].get('auto-create', ["table", "column"])
78+
auto_create = test['insert'].get('auto-create', [])
7979
try:
8080
if auto_create:
8181
self.get_columns_from_insertion_data(test)

0 commit comments

Comments
 (0)