Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Jan 14, 2016
1 parent 0704811 commit 6429e55
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def test_pr_evaluate(self):
)

def test_find_in_comments(self):
prf = PullRequestFilter("test_filter", [], [])
comments_container = [
[AttrDict({'body': '+1', 'expect': True})],
[AttrDict({'body': ':+1:', 'expect': True})],
Expand All @@ -186,14 +185,18 @@ def test_find_in_comments(self):
for x in comments_container:
# Get comments needs to return a callable, so we shoehorn in a
# closure to return 'x'
prf = PullRequestFilter("test_filter", [], [])

def q():
return x

# Then set up as function on fpr. There's probably an easier way to
# do this?
fpr = AttrDict({
# do this but whatever.
prf.issue = AttrDict({
'get_comments': q
})
fpr = AttrDict({
})
result = len(list(prf._find_in_comments(fpr, UPVOTE_REGEX))) > 0,
self.assertEquals(
result[0],
Expand Down

0 comments on commit 6429e55

Please sign in to comment.