~ubuntu-branches/ubuntu/raring/cinder/raring-updates

« back to all changes in this revision

Viewing changes to cinder/tests/test_netapp_nfs.py

  • Committer: Package Import Robot
  • Author(s): Chris J Arges
  • Date: 2013-01-15 10:10:28 UTC
  • mfrom: (7.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130115101028-i1jf2lyewii1xf2e
Tags: 2013.1~g2-0ubuntu2
debian/patches/series: Enable skip_failed_tests to fix FTBFS. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
 
"""Unit tests for the NetApp-specific NFS driver module (netapp_nfs)"""
 
17
"""Unit tests for the NetApp-specific NFS driver module (netapp_nfs)."""
18
18
 
19
19
from cinder import context
20
20
from cinder import exception
67
67
 
68
68
 
69
69
class NetappNfsDriverTestCase(test.TestCase):
70
 
    """Test case for NetApp specific NFS clone driver"""
 
70
    """Test case for NetApp specific NFS clone driver."""
71
71
 
72
72
    def setUp(self):
73
73
        self._driver = netapp_nfs.NetAppNFSDriver()
79
79
    def test_check_for_setup_error(self):
80
80
        mox = self._mox
81
81
        drv = self._driver
82
 
        required_flags = [
83
 
                'netapp_wsdl_url',
84
 
                'netapp_login',
85
 
                'netapp_password',
86
 
                'netapp_server_hostname',
87
 
                'netapp_server_port'
88
 
            ]
 
82
        required_flags = ['netapp_wsdl_url',
 
83
                          'netapp_login',
 
84
                          'netapp_password',
 
85
                          'netapp_server_hostname',
 
86
                          'netapp_server_port']
89
87
 
90
88
        # check exception raises when flags are not set
91
89
        self.assertRaises(exception.CinderException,
124
122
        mox.VerifyAll()
125
123
 
126
124
    def test_create_snapshot(self):
127
 
        """Test snapshot can be created and deleted"""
 
125
        """Test snapshot can be created and deleted."""
128
126
        mox = self._mox
129
127
        drv = self._driver
130
128
 
137
135
        mox.VerifyAll()
138
136
 
139
137
    def test_create_volume_from_snapshot(self):
140
 
        """Tests volume creation from snapshot"""
 
138
        """Tests volume creation from snapshot."""
141
139
        drv = self._driver
142
140
        mox = self._mox
143
141
        volume = FakeVolume(1)
177
175
            mox.StubOutWithMock(drv, '_get_volume_path')
178
176
 
179
177
        drv._get_provider_location(IgnoreArg())
180
 
        drv._volume_not_present(IgnoreArg(), IgnoreArg())\
181
 
                                        .AndReturn(not snapshot_exists)
 
178
        drv._volume_not_present(IgnoreArg(),
 
179
                                IgnoreArg()).AndReturn(not snapshot_exists)
182
180
 
183
181
        if snapshot_exists:
184
182
            drv._get_volume_path(IgnoreArg(), IgnoreArg())