選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

52 行
1.4 KiB

  1. #!/usr/bin/env bats
  2. load test_helper
  3. export PYTHON_BUILD_SKIP_MIRROR=1
  4. export PYTHON_BUILD_CACHE_PATH=
  5. setup() {
  6. export PYTHON_BUILD_BUILD_PATH="${TMP}/source"
  7. mkdir -p "${PYTHON_BUILD_BUILD_PATH}"
  8. }
  9. @test "failed download displays error message" {
  10. stub curl false
  11. install_fixture definitions/without-checksum
  12. assert_failure
  13. assert_output_contains "> http://example.com/packages/package-1.0.0.tar.gz"
  14. assert_output_contains "error: failed to download package-1.0.0.tar.gz"
  15. }
  16. @test "fetching from git repository" {
  17. stub git "clone --depth 1 --branch master http://example.com/packages/package.git package-dev : mkdir package-dev"
  18. run_inline_definition <<DEF
  19. install_git "package-dev" "http://example.com/packages/package.git" master copy
  20. DEF
  21. assert_success
  22. assert_output <<OUT
  23. Cloning http://example.com/packages/package.git...
  24. Installing package-dev...
  25. Installed package-dev to ${TMP}/install
  26. OUT
  27. unstub git
  28. }
  29. @test "updating existing git repository" {
  30. mkdir -p "${PYTHON_BUILD_BUILD_PATH}/package-dev"
  31. stub git \
  32. "fetch --depth 1 origin +master : true" \
  33. "checkout -q -B master origin/master : true"
  34. run_inline_definition <<DEF
  35. install_git "package-dev" "http://example.com/packages/package.git" master copy
  36. DEF
  37. assert_success
  38. assert_output <<OUT
  39. Cloning http://example.com/packages/package.git...
  40. Installing package-dev...
  41. Installed package-dev to ${TMP}/install
  42. OUT
  43. unstub git
  44. }