util_test.go 937 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package my_util
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/log_helper"
  4. "github.com/allanpk716/ChineseSubFinder/internal/pkg/settings"
  5. "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
  6. "path/filepath"
  7. "testing"
  8. )
  9. func TestCloseChrome(t *testing.T) {
  10. // BUG: will produce Logs under this dir
  11. CloseChrome(log_helper.GetLogger())
  12. }
  13. func TestFileNameIsBDMV(t *testing.T) {
  14. rootDir := unit_test_helper.GetTestDataResourceRootPath([]string{"movies", "失控玩家 (2021)"}, 4, false)
  15. dbmvFPath := filepath.Join(rootDir, "CERTIFICATE", "id.bdmv")
  16. bok, fakeVideoFPath := FileNameIsBDMV(dbmvFPath)
  17. if bok == false {
  18. t.Fatal("FileNameIsBDMV error")
  19. }
  20. println(fakeVideoFPath)
  21. }
  22. func TestGetRestOfDaySec(t *testing.T) {
  23. rest := GetRestOfDaySec()
  24. println(rest)
  25. }
  26. func TestGetPublicIP(t *testing.T) {
  27. got := GetPublicIP(log_helper.GetLogger(), settings.NewTaskQueue())
  28. println(got)
  29. }