Skip to content

Commit

Permalink
CLIENT-602 fixing tests that should not be failing
Browse files Browse the repository at this point in the history
  • Loading branch information
rbotzer committed Dec 9, 2015
1 parent 6ff430d commit ccbedc7
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 64 deletions.
46 changes: 31 additions & 15 deletions test/test_geospatial.py
Expand Up @@ -69,10 +69,12 @@ def test_geospatial_put_get_positive(self):

key, meta, bins = TestGeospatial.client.get(key)

assert bins == {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
expected = {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
"int_bin": 2, "string_bin": "str", "dict_bin": {"a": 1, "b": 2,
"geo": {'coordinates': [56.34, 69.62], 'type':
'Point'}}}
for b in bins:
assert b in expected

TestGeospatial.client.remove(key)

Expand All @@ -95,8 +97,10 @@ def callback((key, metadata, record)):
query.foreach(callback)

assert len(records) == 3
assert records == [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
expected = [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_positive_query_outside_shape(self):
"""
Expand Down Expand Up @@ -153,7 +157,9 @@ def callback((key, metadata, record)):
TestGeospatial.client.remove(key)

assert len(records) == 2
assert records == [{'loc': {'coordinates': [-121.8, 37.7], 'type': 'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
expected = [{'loc': {'coordinates': [-121.8, 37.7], 'type': 'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_positive_query_for_circle(self):
"""
Expand Down Expand Up @@ -261,8 +267,10 @@ def callback((key, metadata, record)):
query.foreach(callback)

assert len(records) == 3
assert records == [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
expected = [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_loads_positive(self):
"""
Expand Down Expand Up @@ -306,8 +314,10 @@ def callback((key, metadata, record)):
query.foreach(callback)

assert len(records) == 3
assert records == [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
expected = [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_dumps_positive(self):
"""
Expand Down Expand Up @@ -341,10 +351,12 @@ def test_geospatial_put_get_positive_with_geodata(self):

key, meta, bins = TestGeospatial.client.get(key)

assert bins == {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
expected = {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
"int_bin": 2, "string_bin": "str", "dict_bin": {"a": 1, "b": 2,
"geo": {'coordinates': [56.34, 69.62], 'type':
'Point'}}}
for b in bins:
assert b in expected

TestGeospatial.client.remove(key)

Expand All @@ -364,10 +376,12 @@ def test_geospatial_put_get_positive_with_geojson(self):

key, meta, bins = TestGeospatial.client.get(key)

assert bins == {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
expected = {'loc': {'coordinates': [42.34, 58.62], 'type': 'Point'},
"int_bin": 2, "string_bin": "str", "dict_bin": {"a": 1, "b": 2,
"geo": {'coordinates': [56.34, 69.62], 'type':
'Point'}}}
for b in bins:
assert b in expected

TestGeospatial.client.remove(key)

Expand All @@ -390,8 +404,10 @@ def callback((key, metadata, record)):
query.foreach(callback)

assert len(records) == 3
assert records == [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
expected = [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_positive_query_with_geojson(self):
"""
Expand All @@ -410,8 +426,10 @@ def callback((key, metadata, record)):
query.foreach(callback)

assert len(records) == 3
assert records == [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
expected = [{'loc': {'coordinates': [-122.0, 37.5], 'type': 'Point'}}, {'loc': {'coordinates': [-121.8, 37.7], 'type':
'Point'}}, {'loc': {'coordinates': [-121.6, 37.9], 'type': 'Point'}}]
for r in records:
assert r in expected

def test_geospatial_2dindex_positive(self):
"""
Expand Down Expand Up @@ -447,9 +465,7 @@ def test_geospatial_2dindex_set_length_extra(self):
status = TestGeospatial.client.index_remove('test', 'loc_index')

assert status == 0
try:
status = TestGeospatial.client.index_geo2dsphere_create("test", set_name, "loc", "loc_index")

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == "Invalid Set Name"
try:
status = TestGeospatial.client.index_geo2dsphere_create("test", set_name, "loc", "loc_index")
except InvalidRequest as exception:
assert exception.code == 4
5 changes: 0 additions & 5 deletions test/test_index.py
Expand Up @@ -81,7 +81,6 @@ def test_createindex_with_correct_parameters_set_length_extra(self):
'age', 'age_index', policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Invalid Set Name'

def test_createindex_with_incorrect_namespace(self):
"""
Expand All @@ -94,7 +93,6 @@ def test_createindex_with_incorrect_namespace(self):

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == 'Namespace Not Found'

def test_createindex_with_incorrect_set(self):
"""
Expand Down Expand Up @@ -259,7 +257,6 @@ def test_create_string_index_with_correct_parameters_set_length_extra(self):
'name', 'name_index', policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Invalid Set Name'

def test_create_string_index_with_correct_parameters_ns_length_extra(self):
#Invoke createindex() with correct arguments ns length extra
Expand All @@ -272,7 +269,6 @@ def test_create_string_index_with_correct_parameters_ns_length_extra(self):
'name', 'name_index', policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Namespace Not Found'

def test_create_string_index_with_incorrect_namespace(self):
"""
Expand All @@ -285,7 +281,6 @@ def test_create_string_index_with_incorrect_namespace(self):

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == 'Namespace Not Found'

def test_create_string_index_with_incorrect_set(self):
"""
Expand Down
2 changes: 0 additions & 2 deletions test/test_list_index.py
Expand Up @@ -101,7 +101,6 @@ def test_listindex_with_correct_parameters_set_length_extra(self):
'string_list', aerospike.INDEX_STRING, "test_string_list_index", policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Invalid Set Name'

def test_listindex_with_incorrect_namespace(self):
"""
Expand All @@ -115,7 +114,6 @@ def test_listindex_with_incorrect_namespace(self):

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == 'Namespace Not Found'

def test_listindex_with_incorrect_set(self):
"""
Expand Down
2 changes: 0 additions & 2 deletions test/test_mapkeys_index.py
Expand Up @@ -103,7 +103,6 @@ def test_mapkeys_with_correct_parameters_set_length_extra(self):
'string_map', aerospike.INDEX_STRING, "test_string_map_index", policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Invalid Set Name'

def test_mapkeysindex_with_incorrect_namespace(self):
"""
Expand All @@ -116,7 +115,6 @@ def test_mapkeysindex_with_incorrect_namespace(self):

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == 'Namespace Not Found'

def test_mapkeysindex_with_incorrect_set(self):
"""
Expand Down
2 changes: 0 additions & 2 deletions test/test_mapvalues_index.py
Expand Up @@ -104,7 +104,6 @@ def test_mapvalues_index_with_correct_parameters_set_length_extra(self):
'string_map', aerospike.INDEX_STRING, "test_string_map_index", policy)

assert exception.value[0] == 4
assert exception.value[1] == 'Invalid Set Name'

def test_mapvaluesindex_with_incorrect_namespace(self):
"""
Expand All @@ -117,7 +116,6 @@ def test_mapvaluesindex_with_incorrect_namespace(self):

except InvalidRequest as exception:
assert exception.code == 4
assert exception.msg == 'Namespace Not Found'

def test_mapvaluesindex_with_incorrect_set(self):
"""
Expand Down

0 comments on commit ccbedc7

Please sign in to comment.