2022-05-20 19:40:03 +00:00
|
|
|
package python
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestWheel(t *testing.T) {
|
2022-05-23 09:46:37 +00:00
|
|
|
wheel, err := BuildWheel(context.Background(), "testdata/simple-python-wheel")
|
2022-05-20 19:40:03 +00:00
|
|
|
assert.NoError(t, err)
|
2022-05-23 09:46:37 +00:00
|
|
|
assert.Equal(t, "testdata/simple-python-wheel/dist/dummy-0.0.1-py3-none-any.whl", wheel)
|
2022-05-20 19:40:03 +00:00
|
|
|
|
2022-05-23 09:46:37 +00:00
|
|
|
noFile(t, "testdata/simple-python-wheel/dummy.egg-info")
|
|
|
|
noFile(t, "testdata/simple-python-wheel/__pycache__")
|
|
|
|
noFile(t, "testdata/simple-python-wheel/build")
|
2022-05-20 19:40:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func noFile(t *testing.T, name string) {
|
|
|
|
_, err := os.Stat(name)
|
|
|
|
assert.Error(t, err, "file %s should exist", name)
|
|
|
|
}
|