-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixbug:schema will not upload to service-center when first register (#…
…623) * fixbug:schema will not upload to service-center when first register * Doc update,add: 1、Define the contents of the schema file in URLPatterns() 2、Automatically generate schema file in local directory * fixbug:schema will not upload to service-center when first register Doc update,add: 1、Define the contents of the schema file in URLPatterns() 2、Automatically generate schema file in local directory
- Loading branch information
1 parent
5c2eef9
commit 273aa99
Showing
8 changed files
with
245 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,41 @@ | ||
package lager_test | ||
package lager | ||
|
||
import ( | ||
"github.com/go-chassis/go-chassis/core/lager" | ||
"github.com/stretchr/testify/assert" | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCopyFile(t *testing.T) { | ||
err := ioutil.WriteFile("./test.copy", []byte("test"), 0600) | ||
assert.NoError(t, err) | ||
err = lager.CopyFile("./test.copy", "./test2.copy") | ||
err = CopyFile("./test.copy", "./test2.copy") | ||
assert.NoError(t, err) | ||
b, err := ioutil.ReadFile("./test2.copy") | ||
assert.NoError(t, err) | ||
assert.Equal(t, []byte("test"), b) | ||
} | ||
|
||
func Test_removeFile(t *testing.T) { | ||
ioutil.WriteFile("./remove.copy", []byte("test"), 0600) | ||
p := "remove.copy" | ||
|
||
type args struct { | ||
path string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
wantErr bool | ||
}{ | ||
{"remove", args{p}, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if err := removeFile(tt.args.path); (err != nil) != tt.wantErr { | ||
t.Errorf("removeFile() error = %v, wantErr %v", err, tt.wantErr) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.