Exemplo n.º 1
0
    def test_get_op_version(self):
        '''
        Test retrieving the glusterfs op-version
        '''

        # Test with xml output structure from v3.7
        mock_run = MagicMock(return_value=xml_op_version_37)
        with patch.dict(glusterfs.__salt__, {'cmd.run': mock_run}):
            self.assertEqual(glusterfs.get_op_version('test'), '30707')

        # Test with xml output structure from v3.12
        mock_run = MagicMock(return_value=xml_op_version_312)
        with patch.dict(glusterfs.__salt__, {'cmd.run': mock_run}):
            self.assertEqual(glusterfs.get_op_version('test'), '30707')
Exemplo n.º 2
0
    def test_get_op_version(self):
        """
        Test retrieving the glusterfs op-version
        """

        # Test with xml output structure from v3.7
        mock_run = MagicMock(return_value=xml_op_version_37)
        with patch.dict(glusterfs.__salt__, {"cmd.run": mock_run}):
            self.assertEqual(glusterfs.get_op_version("test"), "30707")

        # Test with xml output structure from v3.12
        mock_run = MagicMock(return_value=xml_op_version_312)
        with patch.dict(glusterfs.__salt__, {"cmd.run": mock_run}):
            self.assertEqual(glusterfs.get_op_version("test"), "30707")