evansde77/cirrus — pull request #35 by jcounts (2014-08-28 15:54:04+00:00)
Title: (WIP) unittests for github_tools

@evansde77

Going to get to that markup issue, but thought it would be a good start to create tests for github_tools. Started with testing build_release_notes, kinda stumped at why my test is failing. Everything looks like it's mocked correctly. I added print statements to make sure right things were being passed, and I checked debugger to make sure types were correct. This is the output when ran:

since_tag: 0.0.0
tags {'commit': {'url': 'https://api.github.com/repos/testorg/testrepo/commits/abc123', 'sha': '123abc'}, 'zipball_url': 'https://api.github.com/repos/testorg/testrepo/zipball/0.0.0', 'tarball_url': 'https://api.github.com/repos/testorg/testrepo/tarball/0.0.0', 'name': '0.0.0'}
E
======================================================================
ERROR: test_build_release_notes (__main__.GithubToolsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jordancounts/git/cirrus/tests/unit/cirrus/github_tools_t.py", line 45, in test_build_release_notes
build_release_notes(OWNER, REPO, RELEASE)
File "/Users/jordancounts/git/cirrus/src/cirrus/github_tools.py", line 182, in build_release_notes
raise RuntimeError(msg)
RuntimeError: Could not find tag 0.0.0 in testorg/testrepo

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)