~bryce/launchpad/lp-642418-no-dupe-set-link

« back to all changes in this revision

Viewing changes to lib/lp/services/scripts/tests/test_cronscript_enabled.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-17 09:16:27 UTC
  • mfrom: (11300.2.18 cronscripts)
  • Revision ID: launchpad@pqm.canonical.com-20100917091627-ae7abye5i7cm99sg
[r=lifeless][ui=none][bug=607391] Load the cronscript control file
        from a URL

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
class TestCronscriptEnabled(TestCase):
 
23
 
23
24
    def setUp(self):
24
25
        super(TestCronscriptEnabled, self).setUp()
25
26
        self.log_output = StringIO()
33
34
        # Ensure a reference is kept until the test is over.
34
35
        # tempfile will then clean itself up.
35
36
        self.addCleanup(lambda x: None, tempfile)
36
 
        return tempfile.name
 
37
        return 'file:' + os.path.abspath(tempfile.name)
37
38
 
38
39
    def test_noconfig(self):
39
 
        enabled = cronscript_enabled('/idontexist.ini', 'foo', self.log)
 
40
        enabled = cronscript_enabled('file:/idontexist.ini', 'foo', self.log)
40
41
        self.assertIs(True, enabled)
41
42
 
42
43
    def test_emptyconfig(self):