2022-05-20 19:40:03 +00:00
|
|
|
package python
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
2022-11-28 10:34:25 +00:00
|
|
|
"runtime"
|
2022-05-20 19:40:03 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestWheel(t *testing.T) {
|
2022-11-28 10:34:25 +00:00
|
|
|
|
|
|
|
// remove this once equivalent tests for windows have been set up
|
|
|
|
// or this test has been fixed for windows
|
|
|
|
// date: 28 Nov 2022
|
|
|
|
if runtime.GOOS == "windows" {
|
|
|
|
t.Skip("skipping temperorilty to make windows unit tests green")
|
|
|
|
}
|
|
|
|
|
|
|
|
// remove this once equivalent tests for macos have been set up
|
|
|
|
// or this test has been fixed for mac os
|
|
|
|
// date: 28 Nov 2022
|
|
|
|
if runtime.GOOS == "darwin" {
|
|
|
|
t.Skip("skipping temperorilty to make macos unit tests green")
|
|
|
|
}
|
|
|
|
|
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)
|
2022-09-07 09:55:59 +00:00
|
|
|
}
|