Esempio n. 1
0
 def test_info_without_install(self):
     with pytest.raises(
             StateCheckError,
             message=
             'Executing info action without install should raise an error'):
         vdisk = Vdisk(name='vdisk', data=self.valid_data)
         vdisk.info()
Esempio n. 2
0
    def test_info(self):
        vdisk = Vdisk(name='vdisk', data=self.valid_data)
        vdisk.data['nsName'] = 'ns_name'
        vdisk.state.set('actions', 'install', 'ok')
        vdisk.api = MagicMock()
        task = task_mock('info')
        vdisk._zerodb.schedule_action = MagicMock(return_value=task)

        assert vdisk.info() == 'info'
        vdisk._zerodb.schedule_action.assert_called_once_with(
            'namespace_info', args={'name': vdisk.data['nsName']})