[ 
https://issues.apache.org/jira/browse/BEAM-13878?focusedWorklogId=733733&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-733733
 ]

ASF GitHub Bot logged work on BEAM-13878:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Feb/22 06:33
            Start Date: 28/Feb/22 06:33
    Worklog Time Spent: 10m 
      Work Description: pavel-avilov commented on a change in pull request 
#16912:
URL: https://github.com/apache/beam/pull/16912#discussion_r815611170



##########
File path: playground/backend/internal/fs_tool/path_checker_test.go
##########
@@ -0,0 +1,93 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package fs_tool
+
+import (
+       "fmt"
+       "path/filepath"
+       "testing"
+)
+
+func TestWrongExtension_Error(t *testing.T) {
+       errorMessage := "MOCK_ERROR"
+       type fields struct {
+               error string
+       }
+       tests := []struct {
+               name   string
+               fields fields
+               want   string
+       }{
+               {
+                       name:   "All success",

Review comment:
       Done

##########
File path: playground/backend/internal/fs_tool/path_checker_test.go
##########
@@ -0,0 +1,93 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package fs_tool
+
+import (
+       "fmt"
+       "path/filepath"
+       "testing"
+)
+
+func TestWrongExtension_Error(t *testing.T) {
+       errorMessage := "MOCK_ERROR"
+       type fields struct {
+               error string
+       }
+       tests := []struct {
+               name   string
+               fields fields
+               want   string
+       }{
+               {
+                       name:   "All success",
+                       fields: fields{error: errorMessage},
+                       want:   fmt.Sprintf("File has wrong extension: %v", 
errorMessage),
+               },
+       }
+       for _, tt := range tests {
+               t.Run(tt.name, func(t *testing.T) {
+                       e := &WrongExtension{
+                               error: tt.fields.error,
+                       }
+                       if got := e.Error(); got != tt.want {
+                               t.Errorf("Error() = %v, want %v", got, tt.want)
+                       }
+               })
+       }
+}
+
+func TestCheckPathIsValid(t *testing.T) {
+       type args struct {
+               args []interface{}
+       }
+       tests := []struct {
+               name    string
+               args    args
+               want    bool
+               wantErr bool
+       }{
+               {
+                       name:    "File not exist",
+                       args:    args{args: []interface{}{"filePath.txt", 
".txt"}},
+                       want:    false,
+                       wantErr: true,
+               },
+               {
+                       name:    "Incorrect extension",
+                       args:    args{args: 
[]interface{}{filepath.Join(sourceDir, fileName), JavaSourceFileExtension}},
+                       want:    false,
+                       wantErr: true,
+               },
+               {
+                       name:    "All success",

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 733733)
    Time Spent: 1h 20m  (was: 1h 10m)

> [Playground] Increase test coverage for the fs_tool package
> -----------------------------------------------------------
>
>                 Key: BEAM-13878
>                 URL: https://issues.apache.org/jira/browse/BEAM-13878
>             Project: Beam
>          Issue Type: Sub-task
>          Components: beam-playground
>            Reporter: Aydar Zaynutdinov
>            Assignee: Pavel Avilov
>            Priority: P3
>              Labels: beam-playground-backend
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Need to add unit tests to increase test coverage for the _fs_tool_ package.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to