getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.

Home Page:http://docs.getmoto.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S3: get/head with partNumber is returning 200 status code instead of 206

vincer opened this issue · comments

s3 = boto3.resource("s3")
s3.create_bucket(Bucket="bucket")
s3.Object("bucket", "some-key").put(Body="foo")

assert s3.meta.client.head_object(Bucket="bucket", Key="some-key", PartNumber=1)["ResponseMetadata"]["HTTPStatusCode"] == 206

Since it's effectively a range request, it should return 206, not 200. Same for get_object.