test_simple.py 880 B

123456789101112131415161718192021222324
  1. import library.python.svn_version as sv
  2. def test_simple():
  3. assert sv.svn_version()
  4. assert isinstance(sv.svn_version(), str)
  5. assert sv.vcs()
  6. assert isinstance(sv.vcs(), str)
  7. # svn_revision() will be -1 on non-trunk commits via arc
  8. # svn revision of 0 technically may exist, but practiacally it will never appear here
  9. assert sv.svn_revision() >= 0 or (sv.vcs() != "svn" and sv.svn_revision() == -1)
  10. assert isinstance(sv.svn_revision(), int)
  11. # svn_last_revision() will be equal to zero on non-trunk commits
  12. assert sv.svn_last_revision() >= 0 or (sv.vcs() != "svn" and sv.svn_last_revision() == -1)
  13. assert isinstance(sv.svn_last_revision(), int)
  14. assert sv.commit_id()
  15. assert isinstance(sv.commit_id(), str)
  16. assert len(sv.commit_id()) > 0
  17. assert isinstance(sv.hash(), str)
  18. assert isinstance(sv.patch_number(), int)