-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from kcl-lang/fix-git-download-failure
fix: fix git downloading failure
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package source | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
) | ||
|
||
func TestReadThroughGetter(t *testing.T) { | ||
tmpDir, _, err := ReadThroughGetter("git::https://github.com/kcl-lang/flask-demo-kcl-manifests.git") | ||
if err != nil { | ||
t.Errorf("TestReadThroughGetter() error = %v", err) | ||
return | ||
} | ||
|
||
// Check if tmpDir exists | ||
if _, err := os.Stat(tmpDir); os.IsNotExist(err) { | ||
t.Errorf("TestReadThroughGetter() tmpDir does not exist") | ||
} | ||
|
||
// Check if kcl.mod file exists in tmpDir | ||
kclModPath := filepath.Join(tmpDir, "kcl.mod") | ||
if _, err := os.Stat(kclModPath); os.IsNotExist(err) { | ||
t.Errorf("TestReadThroughGetter() kcl.mod file does not exist in tmpDir") | ||
} | ||
} |