~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/jobs/tests/test_bzr.py

  • Committer: Aaron Bentley
  • Date: 2013-02-12 18:57:02 UTC
  • mfrom: (149 charmworld)
  • mto: This revision was merged to the branch mainline in revision 150.
  • Revision ID: aaron@canonical.com-20130212185702-9gnf40ao17a7uw7v
Merged trunk into mongo-urls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from mock import patch
6
6
 
7
7
from charmworld.jobs import config
8
 
from charmworld.jobs.bzr import fetch_branches
 
8
from charmworld.jobs.worker import fetch_branches
9
9
from charmworld.testing import get_bad_mock
10
10
from charmworld.testing import JobTestBase
11
11
 
12
12
 
13
13
class TestBzrJob(JobTestBase):
14
14
 
15
 
    @patch('charmworld.jobs.bzr.fetch_branch', get_bad_mock())
 
15
    # Patch has to happen along `worker` path rather than the `ingest` module
 
16
    # b/c of Mock/import interactions.
 
17
    @patch('charmworld.jobs.worker.fetch_branch', get_bad_mock())
16
18
    def test_fetch_branches_records_failure(self):
17
19
        handler = self.get_handler("charm.bzr")
18
20
        charm_data = {'branch_dir': 'foo', 'branch_spec': 'bar'}
24
26
                   "forced by mock.")
25
27
        self.assertIn(err_msg, log_messages)
26
28
 
27
 
    @patch('charmworld.jobs.bzr.fetch_branch', Mock())
 
29
    # Patch has to happen along `worker` path rather than the `ingest` module
 
30
    # b/c of Mock/import interactions.
 
31
    @patch('charmworld.jobs.worker.fetch_branch', Mock())
28
32
    def test_fetch_branches_out_queue(self):
29
33
        charm_data = {'branch_dir': 'foo', 'branch_spec': 'bar'}
30
34
        (in_queue, out_queue) = self.get_mongo_queues(data=charm_data)