~ubuntu-branches/ubuntu/trusty/maas/trusty-security

« back to all changes in this revision

Viewing changes to src/provisioningserver/tests/test_tasks.py

  • Committer: Package Import Robot
  • Author(s): Greg Lutostanski
  • Date: 2014-06-02 11:57:58 UTC
  • mto: (61.1.2 trusty-proposed)
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: package-import@ubuntu.com-20140602115758-iu3455vh53mhpd0f
Tags: upstream-1.5.2+bzr2282
ImportĀ upstreamĀ versionĀ 1.5.2+bzr2282

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
        self.assertThat(tasks.call_and_check, MockCalledOnceWith(
331
331
            ['sudo', '-n', 'service', 'maas-dhcp-server', 'restart']))
332
332
 
333
 
    def test_stop_dhcp_server_sends_command(self):
 
333
    def test_stop_dhcp_server_sends_command_and_writes_empty_config(self):
334
334
        self.patch(tasks, 'call_and_check')
 
335
        self.patch(tasks, 'sudo_write_file')
335
336
        stop_dhcp_server()
336
337
        self.assertThat(tasks.call_and_check, MockCalledOnceWith(
337
338
            ['sudo', '-n', 'service', 'maas-dhcp-server', 'stop']))
 
339
        self.assertThat(tasks.sudo_write_file, MockCalledOnceWith(
 
340
            celery_config.DHCP_CONFIG_FILE, tasks.DISABLED_DHCP_SERVER))
338
341
 
339
342
 
340
343
def assertTaskRetried(runner, result, nb_retries, task_name):