Guest User

Untitled

a guest
Jan 13th, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #I tried python-redmine in the my machine that is running software-factory at http://sftests.com.
  2. #Proj a100 has 27 issues. And the api returns the right output.
  3.  
  4. >>> from redmine import Redmine
  5. >>> redmine = Redmine('http://sftests.com/redmine', username='admin', password='userpass')
  6. >>> proj = redmine.project.get('a100')
  7. >>> proj.name
  8. u'a100'
  9. >>> proj.issues
  10. <redmine.resultsets.ResourceSet object with Issue resources>
  11. >>> proj.issues[0]
  12. <redmine.resources.Issue #27 "oiuou">
  13. >>> proj.issues[1]
  14. <redmine.resources.Issue #26 "owiefosdfsd">
  15. >>> proj.issues.total_count
  16. 27
  17.  
  18. #I tried with another proj a99 that has 3 issues.
  19. >>> proj2 = redmine.project.get('a99')
  20. >>> proj2.name
  21. u'a99'
  22. >>> proj2.issues.total_count
  23. Traceback (most recent call last):
  24. File "<stdin>", line 1, in <module>
  25. File "/usr/lib/python2.7/site-packages/redmine/resultsets.py", line 70, in total_count
  26. raise ResultSetTotalCountError
  27. redmine.exceptions.ResultSetTotalCountError: Total count is unknown before evaluation
  28.  
  29. #Don't know why the above error occured.
  30. >>> proj2.issues[0]
  31. <redmine.resources.Issue #30 "odjsdf">
  32. >>> proj2.issues.total_count
  33. 3
  34.  
  35.  
  36. --------------------------------------------------------------------
  37. Let me look into the curl request output for https://github.com/redhat-cip/pysflib/blob/master/pysflib/sfredmine.py#L120
Add Comment
Please, Sign In to add comment