Merge "Address TODO in schema"
This commit is contained in:
commit
5ec4d100ec
@ -26,13 +26,13 @@ patch_options = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# NOTE(cpp-cabrera): a string valid for use in a URI
|
|
||||||
# TODO(cpp-cabrera): perhaps validate this further using jsonschema's
|
|
||||||
# uri validator as per rfc3987
|
|
||||||
patch_uri = {
|
patch_uri = {
|
||||||
'type': 'object', 'properties': {
|
'type': 'object', 'properties': {
|
||||||
'uri': {
|
'uri': {
|
||||||
'type': 'string'
|
'type': 'string',
|
||||||
|
'minLength': 0,
|
||||||
|
'maxLength': 255,
|
||||||
|
'format': 'uri'
|
||||||
},
|
},
|
||||||
'additionalProperties': False
|
'additionalProperties': False
|
||||||
}
|
}
|
||||||
@ -41,7 +41,9 @@ patch_uri = {
|
|||||||
patch_group = {
|
patch_group = {
|
||||||
'type': 'object', 'properties': {
|
'type': 'object', 'properties': {
|
||||||
'uri': {
|
'uri': {
|
||||||
'type': 'string'
|
'type': 'string',
|
||||||
|
'minLength': 0,
|
||||||
|
'maxLength': 255
|
||||||
},
|
},
|
||||||
'additionalProperties': False
|
'additionalProperties': False
|
||||||
}
|
}
|
||||||
|
@ -63,12 +63,13 @@ def pools(test, count, uri):
|
|||||||
:returns: (paths, weights, uris, options)
|
:returns: (paths, weights, uris, options)
|
||||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||||
"""
|
"""
|
||||||
|
mongo_url = uri
|
||||||
base = test.url_prefix + '/pools/'
|
base = test.url_prefix + '/pools/'
|
||||||
args = [(base + str(i), i,
|
args = [(base + str(i), i,
|
||||||
{str(i): i})
|
{str(i): i})
|
||||||
for i in range(count)]
|
for i in range(count)]
|
||||||
for path, weight, option in args:
|
for path, weight, option in args:
|
||||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||||
doc = {'weight': weight, 'uri': uri, 'options': option}
|
doc = {'weight': weight, 'uri': uri, 'options': option}
|
||||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||||
|
|
||||||
|
@ -65,12 +65,13 @@ def pools(test, count, uri, group):
|
|||||||
:returns: (paths, weights, uris, options)
|
:returns: (paths, weights, uris, options)
|
||||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||||
"""
|
"""
|
||||||
|
mongo_url = uri
|
||||||
base = test.url_prefix + '/pools/'
|
base = test.url_prefix + '/pools/'
|
||||||
args = [(base + str(i), i,
|
args = [(base + str(i), i,
|
||||||
{str(i): i})
|
{str(i): i})
|
||||||
for i in range(count)]
|
for i in range(count)]
|
||||||
for path, weight, option in args:
|
for path, weight, option in args:
|
||||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||||
doc = {'weight': weight, 'uri': uri,
|
doc = {'weight': weight, 'uri': uri,
|
||||||
'group': group, 'options': option}
|
'group': group, 'options': option}
|
||||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||||
|
@ -64,12 +64,13 @@ def pools(test, count, uri, group):
|
|||||||
:returns: (paths, weights, uris, options)
|
:returns: (paths, weights, uris, options)
|
||||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||||
"""
|
"""
|
||||||
|
mongo_url = uri
|
||||||
base = test.url_prefix + '/pools/'
|
base = test.url_prefix + '/pools/'
|
||||||
args = [(base + str(i), i,
|
args = [(base + str(i), i,
|
||||||
{str(i): i})
|
{str(i): i})
|
||||||
for i in range(count)]
|
for i in range(count)]
|
||||||
for path, weight, option in args:
|
for path, weight, option in args:
|
||||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||||
doc = {'weight': weight, 'uri': uri,
|
doc = {'weight': weight, 'uri': uri,
|
||||||
'group': group, 'options': option}
|
'group': group, 'options': option}
|
||||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user