Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refactor harness to fix breaks after plugin change

  • Loading branch information...
commit 2959e4a6e008ec29a4132993926feab740287633 1 parent 398f9ae
Brad Taylor btaylor-litl authored

Showing 1 changed file with 11 additions and 5 deletions. Show diff stats Hide diff stats

  1. +11 5 timeline/tests.py
16 timeline/tests.py
@@ -24,13 +24,14 @@
24 24 from datetime import datetime
25 25
26 26 from django.test import TestCase
  27 +from django.test.client import Client
27 28
28 29 from berserk2.timeline.models import Event, Actor
29   -from berserk2.timeline.sources import FogBugzEmailSource, GitHubPushSource
30 30
31 31 class FogBugzEmailSourceTokenizerTest(TestCase):
32 32 def setUp(self):
33   - self.fb = FogBugzEmailSource()
  33 + from berserk2.timeline.plugins.fogbugz import PeriodicPollSource
  34 + self.fb = PeriodicPollSource()
34 35
35 36 def _get_tokens_from_file(self, file):
36 37 f = open(file, 'r')
@@ -162,7 +163,8 @@ def test_qa_assignee(self):
162 163
163 164 class FogBugzEmailSourceParserTest(TestCase):
164 165 def setUp(self):
165   - self.fb = FogBugzEmailSource()
  166 + from berserk2.timeline.plugins.fogbugz import PeriodicPollSource
  167 + self.fb = PeriodicPollSource()
166 168
167 169 def _parse_file(self, file):
168 170 f = open(file, 'r')
@@ -509,11 +511,15 @@ def test_edited_removed_tag(self):
509 511
510 512 class GitHubPushSourceTest(TestCase):
511 513 def setUp(self):
512   - self.gh = GitHubPushSource()
  514 + from berserk2.timeline.plugins.github import PushSource
  515 + self.gh = PushSource()
  516 + self.client = Client()
513 517
514 518 def _process_payload(self, file):
515 519 f = open(file, 'r')
516   - self.gh.process_payload('\n'.join(f.readlines()))
  520 + self.client.post('/timeline/push/github', {
  521 + 'payload': '\n'.join(f.readlines())
  522 + })
517 523 f.close()
518 524
519 525 def test_github_example(self):

0 comments on commit 2959e4a

Please sign in to comment.
Something went wrong with that request. Please try again.