mirror of https://github.com/databricks/cli.git
rename `internal/test` to idiomatic `testdata`
This commit is contained in:
parent
0d76ab3d28
commit
95a68937fe
|
@ -11,12 +11,12 @@ import (
|
||||||
func TestFindProjectRoot(t *testing.T) {
|
func TestFindProjectRoot(t *testing.T) {
|
||||||
wd, _ := os.Getwd()
|
wd, _ := os.Getwd()
|
||||||
defer os.Chdir(wd)
|
defer os.Chdir(wd)
|
||||||
err := os.Chdir("internal/test/a/b/c")
|
err := os.Chdir("testdata/a/b/c")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
root, err := findProjectRoot()
|
root, err := findProjectRoot()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, fmt.Sprintf("%s/internal/test", wd), root)
|
assert.Equal(t, fmt.Sprintf("%s/testdata", wd), root)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFindProjectRootInRoot(t *testing.T) {
|
func TestFindProjectRootInRoot(t *testing.T) {
|
||||||
|
@ -37,7 +37,7 @@ func TestGetGitOrigin(t *testing.T) {
|
||||||
func TestLoadProjectConf(t *testing.T) {
|
func TestLoadProjectConf(t *testing.T) {
|
||||||
wd, _ := os.Getwd()
|
wd, _ := os.Getwd()
|
||||||
defer os.Chdir(wd)
|
defer os.Chdir(wd)
|
||||||
os.Chdir("internal/test/a/b/c")
|
os.Chdir("testdata/a/b/c")
|
||||||
|
|
||||||
prj, err := loadProjectConf()
|
prj, err := loadProjectConf()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
|
@ -15,7 +15,7 @@ func TestFreeze(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPyInlineX(t *testing.T) {
|
func TestPyInlineX(t *testing.T) {
|
||||||
defer chdirAndBack("internal/test/simple-python-wheel")()
|
defer chdirAndBack("testdata/simple-python-wheel")()
|
||||||
dist, err := ReadDistribution(context.Background())
|
dist, err := ReadDistribution(context.Background())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, "dummy", dist.Name)
|
assert.Equal(t, "dummy", dist.Name)
|
||||||
|
|
|
@ -9,13 +9,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWheel(t *testing.T) {
|
func TestWheel(t *testing.T) {
|
||||||
wheel, err := BuildWheel(context.Background(), "internal/test/simple-python-wheel")
|
wheel, err := BuildWheel(context.Background(), "testdata/simple-python-wheel")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, "internal/test/simple-python-wheel/dist/dummy-0.0.1-py3-none-any.whl", wheel)
|
assert.Equal(t, "testdata/simple-python-wheel/dist/dummy-0.0.1-py3-none-any.whl", wheel)
|
||||||
|
|
||||||
noFile(t, "internal/test/simple-python-wheel/dummy.egg-info")
|
noFile(t, "testdata/simple-python-wheel/dummy.egg-info")
|
||||||
noFile(t, "internal/test/simple-python-wheel/__pycache__")
|
noFile(t, "testdata/simple-python-wheel/__pycache__")
|
||||||
noFile(t, "internal/test/simple-python-wheel/build")
|
noFile(t, "testdata/simple-python-wheel/build")
|
||||||
}
|
}
|
||||||
|
|
||||||
func noFile(t *testing.T, name string) {
|
func noFile(t *testing.T, name string) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
func TestSomething(t *testing.T) {
|
func TestSomething(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
tf, err := newTerraform(ctx, "internal/test/simplest", map[string]string{
|
tf, err := newTerraform(ctx, "testdata/simplest", map[string]string{
|
||||||
"DATABRICKS_HOST": "..",
|
"DATABRICKS_HOST": "..",
|
||||||
"DATABRICKS_TOKEN": "..",
|
"DATABRICKS_TOKEN": "..",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue