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

test_basics.py 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from contextlib import contextmanager
  2. from tests import DDS
  3. from tests.fileutil import ensure_dir, set_contents
  4. def test_build_empty(dds: DDS):
  5. assert not dds.source_root.exists()
  6. dds.scope.enter_context(ensure_dir(dds.source_root))
  7. dds.build()
  8. def test_build_simple(dds: DDS):
  9. dds.scope.enter_context(
  10. set_contents(dds.source_root / 'src/f.cpp', b'void foo() {}'))
  11. dds.build()
  12. def basic_pkg_dds(dds: DDS):
  13. return set_contents(
  14. dds.source_root / 'package.json5', b'''
  15. {
  16. name: 'test-pkg',
  17. version: '0.2.2',
  18. }
  19. ''')
  20. def test_empty_with_pkg_dds(dds: DDS):
  21. dds.scope.enter_context(basic_pkg_dds(dds))
  22. dds.build()
  23. def test_empty_with_lib_dds(dds: DDS):
  24. dds.scope.enter_context(basic_pkg_dds(dds))
  25. dds.build()
  26. def test_empty_sdist_create(dds: DDS):
  27. dds.scope.enter_context(basic_pkg_dds(dds))
  28. dds.sdist_create()
  29. def test_empty_sdist_export(dds: DDS):
  30. dds.scope.enter_context(basic_pkg_dds(dds))
  31. dds.sdist_export()