Skip to content

Commit 5b85672

Browse files
RachelTuckerrpmoore
authored andcommitted
NEO-2021: adding test for percent encoding horizontal tab character in file object name. Also, fixed logical bug in existing tests that was causing the retrieval step to be skipped. (#89)
1 parent cc2d0e9 commit 5b85672

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ds3/networking/httpRequestBuilder_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestBuildUrlEscapingPath(t *testing.T) {
3030
{input:"%", encoded:"%25"},
3131
{input:"#", encoded:"%23"},
3232
{input:"'", encoded:"%27"},
33+
{input:"\t", encoded:"%09"},
3334
}
3435

3536
const bucketName = "myBucket"

ds3_integration/smoke_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ func TestObject(t *testing.T) {
8080

8181
//Verify that object exists
8282
getObjectResponse, getObjErr := testutils.GetObjectLogError(t, client, testBucket, beowulf)
83-
if getObjErr != nil {
83+
ds3Testing.AssertNilError(t, putObjErr)
84+
if getObjErr == nil {
8485
defer getObjectResponse.Content.Close()
8586
bs, readErr := ioutil.ReadAll(getObjectResponse.Content)
8687
ds3Testing.AssertNilError(t, readErr)
@@ -93,7 +94,7 @@ func TestObject(t *testing.T) {
9394
func TestPutGetFilePercentEncodingObjectNames(t *testing.T) {
9495
defer testutils.DeleteBucketContents(client, testBucket)
9596

96-
inputSymbols := []string {"-", ".", "_", "~", "!", "$", "'", "(", ")", "*", ",", "&", "=", "@", ":", "/", ";", "+", "?", " ", "%", "#", "'"}
97+
inputSymbols := []string {"-", ".", "_", "~", "!", "$", "'", "(", ")", "*", ",", "&", "=", "@", ":", "/", ";", "+", "?", " ", "%", "#", "'", "\t"}
9798

9899
for i, input := range inputSymbols {
99100
objectName := fmt.Sprintf("test%ssymbol%d", input, i)
@@ -108,7 +109,8 @@ func TestPutGetFilePercentEncodingObjectNames(t *testing.T) {
108109

109110
//Verify that object exists
110111
getObjectResponse, getObjErr := testutils.GetObjectLogError(t, client, testBucket, objectName)
111-
if getObjErr != nil {
112+
ds3Testing.AssertNilError(t, getObjErr)
113+
if getObjErr == nil {
112114
defer getObjectResponse.Content.Close()
113115
retrievedContent, readErr := ioutil.ReadAll(getObjectResponse.Content)
114116
ds3Testing.AssertNilError(t, readErr)

0 commit comments

Comments
 (0)