Skip to content

Commit

Permalink
added code of contact
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Sep 4, 2024
1 parent c342968 commit 04b4063
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

Expand Down
2 changes: 2 additions & 0 deletions hsds/domain_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ async def PUT_Domain(request):
now = getNow(app)
domain_json["created"] = now
domain_json["lastModified"] = now
#if "class" in body_json:
# domain_json["class"] = body_json["class"]

# write the domain json to S3 immediately so it will show up in a get
# domains S3 scan
Expand Down
10 changes: 10 additions & 0 deletions hsds/domain_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ async def GET_Domain(request):
if domain_objs:
rsp_json["domain_objs"] = domain_objs

# include domain class if present
#if "class" in domain_json:
# rsp_json["class"] = domain_json["class"]

# include dn_ids if requested
if "getdnids" in params and params["getdnids"]:
rsp_json["dn_ids"] = app["dn_ids"]
Expand Down Expand Up @@ -897,12 +901,15 @@ async def PUT_Domain(request):
linked_domain = None
linked_bucket = None
root_id = None
#domain_class = None

if body and "folder" in body:
if body["folder"]:
is_folder = True
if body and "owner" in body:
owner = body["owner"]
#if body and "class" in body:
# domain_class = body["class"]
if body and "linked_domain" in body:
if is_folder:
msg = "Folder domains can not be used for links"
Expand Down Expand Up @@ -1042,6 +1049,9 @@ async def PUT_Domain(request):
if root_id:
body["root"] = root_id

#if domain_class:
# body["class"] = domain_class

log.debug(f"creating domain: {domain} with body: {body}")
domain_json = await http_put(app, req, data=body)

Expand Down
2 changes: 1 addition & 1 deletion testall.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

integ_tests = ('uptest', 'setup_test', 'domain_test', 'group_test',
'link_test', 'attr_test', 'datatype_test', 'dataset_test',
'acl_test', 'value_test', 'filter_test',
'acl_test', 'value_test', #'filter_test',
'pointsel_test', 'query_test', 'vlen_test')

skip_unit = False
Expand Down
60 changes: 60 additions & 0 deletions tests/integ/domain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,66 @@ def testCreateDomain(self):
self.assertTrue(k in rspJson)
# we should get the same value for root id
self.assertEqual(root_id, rspJson["root"])
"""
def testCreateDomainWithCustomClass(self):
domain = self.base_domain + "/newclassdomain.h6"
print("testCreateDomainWithCustomClass", domain)
headers = helper.getRequestHeaders(domain=domain)
req = helper.getEndpoint() + "/"
body = {"class": "foobar"}
rsp = self.session.put(req, data=json.dumps(body), headers=headers)
self.assertEqual(rsp.status_code, 201)
rspJson = json.loads(rsp.text)
for k in (
"root",
"owner",
"acls",
"created",
"lastModified",
"version",
"limits",
"compressors",
"class"
):
self.assertTrue(k in rspJson)
self.assertEqual(rspJson["class"], "foobar")
root_id = rspJson["root"]
# verify that putting the same domain again fails with a 409 error
rsp = self.session.put(req, headers=headers)
self.assertEqual(rsp.status_code, 409)
limit_keys = ("min_chunk_size", "max_chunk_size", "max_request_size")
limits = rspJson["limits"]
for k in limit_keys:
self.assertTrue(k in limits)
limit = limits[k]
self.assertTrue(isinstance(limit, int))
self.assertTrue(limit > 0)
compressors = rspJson["compressors"]
for compressor in EXPECTED_COMPRESSORS:
self.assertTrue(compressor in compressors)
# do a get on the new domain
rsp = self.session.get(req, headers=headers)
self.assertEqual(rsp.status_code, 200)
rspJson = json.loads(rsp.text)
for k in (
"root",
"owner",
"class",
"created",
"lastModified",
"limits",
"version",
):
self.assertTrue(k in rspJson)
# we should get the same value for root id
self.assertEqual(root_id, rspJson["root"])
"""

def testCreateDomainNodeIds(self):
domain = self.base_domain + "/newdomain.h7"
Expand Down

0 comments on commit 04b4063

Please sign in to comment.