Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for POST dset with zero chunk extent #236

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/integ/attr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class AttributeTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(AttributeTest, self).__init__(*args, **kwargs)
self.base_domain = helper.getTestDomainName(self.__class__.__name__)
print(self.base_domain)
self.endpoint = helper.getEndpoint()
helper.setupDomain(self.base_domain)

Expand Down
24 changes: 24 additions & 0 deletions tests/integ/dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,30 @@ def testExtendibleDatasetChunkPartitioning(self):
self.assertTrue(chunk_size >= CHUNK_MIN)
self.assertTrue(chunk_size <= CHUNK_MAX)

def testDatasetEmptyChunkExtent(self):
# Attempting to create 0-extent chunks should respond with Bad Request
domain = self.base_domain + "/testDatasetEmptyChunkExtent.h5"
helper.setupDomain(domain)
print("testDatasetEmptyChunkExtent", domain)
headers = helper.getRequestHeaders(domain=domain)
req = helper.getEndpoint() + "/"

# create the dataset
req = self.endpoint + "/datasets"

dims = [1]
payload = {"type": "H5T_IEEE_F32LE",
"shape": dims}

payload["creationProperties"] = {
"layout": {"class": "H5D_CHUNKED", "dims": [0]}
}

req = self.endpoint + "/datasets"
rsp = self.session.post(req, data=json.dumps(payload), headers=headers)
# Should fail with Bad Request due to invalid layout value
self.assertEqual(rsp.status_code, 400) # create dataset


if __name__ == "__main__":
# setup test files
Expand Down