~lutostag/ubuntu/trusty/maas/1.5.2+packagefix

« back to all changes in this revision

Viewing changes to src/metadataserver/commissioning/tests/test_user_data.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2014-03-28 10:43:53 UTC
  • mto: This revision was merged to the branch mainline in revision 57.
  • Revision ID: package-import@ubuntu.com-20140328104353-ekpolg0pm5xnvq2s
Tags: upstream-1.5+bzr2204
ImportĀ upstreamĀ versionĀ 1.5+bzr2204

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012-2013 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2012-2014 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Test generation of commissioning user data."""
16
16
 
17
17
from maasserver.testing.factory import factory
18
18
from maasserver.testing.testcase import MAASServerTestCase
 
19
from maastesting.matchers import MockCalledWith
19
20
from metadataserver.commissioning import user_data
20
21
from metadataserver.commissioning.user_data import generate_user_data
21
22
from mock import (
47
48
        user_data.get_preseed_context = Mock(return_value=fake_context)
48
49
        nodegroup = sentinel.nodegroup
49
50
        generate_user_data(nodegroup)
50
 
        user_data.get_preseed_context.assert_called_with(nodegroup=nodegroup)
 
51
        self.assertThat(
 
52
            user_data.get_preseed_context,
 
53
            MockCalledWith(nodegroup=nodegroup))
51
54
 
52
55
    def test_generate_user_data_generates_mime_multipart(self):
53
56
        # The generate_user_data func should create a MIME multipart