Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor harness to fix breaks after plugin change

  • Loading branch information...
commit 2959e4a6e008ec29a4132993926feab740287633 1 parent 398f9ae
@btaylor-litl btaylor-litl authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 timeline/tests.py
View
16 timeline/tests.py
@@ -24,13 +24,14 @@
from datetime import datetime
from django.test import TestCase
+from django.test.client import Client
from berserk2.timeline.models import Event, Actor
-from berserk2.timeline.sources import FogBugzEmailSource, GitHubPushSource
class FogBugzEmailSourceTokenizerTest(TestCase):
def setUp(self):
- self.fb = FogBugzEmailSource()
+ from berserk2.timeline.plugins.fogbugz import PeriodicPollSource
+ self.fb = PeriodicPollSource()
def _get_tokens_from_file(self, file):
f = open(file, 'r')
@@ -162,7 +163,8 @@ def test_qa_assignee(self):
class FogBugzEmailSourceParserTest(TestCase):
def setUp(self):
- self.fb = FogBugzEmailSource()
+ from berserk2.timeline.plugins.fogbugz import PeriodicPollSource
+ self.fb = PeriodicPollSource()
def _parse_file(self, file):
f = open(file, 'r')
@@ -509,11 +511,15 @@ def test_edited_removed_tag(self):
class GitHubPushSourceTest(TestCase):
def setUp(self):
- self.gh = GitHubPushSource()
+ from berserk2.timeline.plugins.github import PushSource
+ self.gh = PushSource()
+ self.client = Client()
def _process_payload(self, file):
f = open(file, 'r')
- self.gh.process_payload('\n'.join(f.readlines()))
+ self.client.post('/timeline/push/github', {
+ 'payload': '\n'.join(f.readlines())
+ })
f.close()
def test_github_example(self):
Please sign in to comment.
Something went wrong with that request. Please try again.