test_python_incremental.py 955 B

12345678910111213141516171819202122232425262728293031323334
  1. from tests.package.test_python import TestPythonBase
  2. class TestPythonIncremental(TestPythonBase):
  3. def str_test(self):
  4. cmd = self.interpreter + " -c 'import incremental;"
  5. cmd += "v = incremental.Version(\"package\", 1, 2, 3, release_candidate=4);"
  6. cmd += "assert(str(v) == \"[package, version 1.2.3rc4]\")'"
  7. _, exit_code = self.emulator.run(cmd, timeout=30)
  8. self.assertEqual(exit_code, 0)
  9. class TestPythonPy2Incremental(TestPythonIncremental):
  10. config = TestPythonBase.config + \
  11. """
  12. BR2_PACKAGE_PYTHON=y
  13. BR2_PACKAGE_PYTHON_INCREMENTAL=y
  14. """
  15. def test_run(self):
  16. self.login()
  17. self.str_test()
  18. class TestPythonPy3Incremental(TestPythonIncremental):
  19. config = TestPythonBase.config + \
  20. """
  21. BR2_PACKAGE_PYTHON3=y
  22. BR2_PACKAGE_PYTHON_INCREMENTAL=y
  23. """
  24. def test_run(self):
  25. self.login()
  26. self.str_test()