Esempio n. 1
0
    def test_remove(self):
        '''
        Test for Remove log pattern from logadm
        '''
        with patch.dict(
                logadm.__salt__, {
                    'cmd.run_all':
                    MagicMock(return_value={
                        'retcode': 1,
                        'stderr': 'stderr'
                    })
                }):
            self.assertEqual(
                logadm.remove('name'), {
                    'Output': 'stderr',
                    'Error': 'Failure in removing log. Possibly\
 already removed?'
                })

        with patch.dict(
                logadm.__salt__, {
                    'cmd.run_all':
                    MagicMock(return_value={
                        'retcode': 0,
                        'stderr': 'stderr'
                    })
                }):
            self.assertEqual(logadm.remove('name'), {'Result': 'Success'})
Esempio n. 2
0
    def test_remove(self):
        """
        Test for Remove log pattern from logadm
        """
        with patch.dict(
                logadm.__salt__,
            {
                "cmd.run_all":
                MagicMock(return_value={
                    "retcode": 1,
                    "stderr": "stderr"
                })
            },
        ):
            self.assertEqual(
                logadm.remove("name"),
                {
                    "Output": "stderr",
                    "Error":
                    "Failure in removing log. Possibly already removed?",
                },
            )

        with patch.dict(
                logadm.__salt__,
            {
                "cmd.run_all":
                MagicMock(return_value={
                    "retcode": 0,
                    "stderr": "stderr"
                })
            },
        ):
            self.assertEqual(logadm.remove("name"), {"Result": "Success"})
Esempio n. 3
0
    def test_remove(self):
        '''
        Test for Remove log pattern from logadm
        '''
        with patch.dict(logadm.__salt__,
                        {'cmd.run_all':
                         MagicMock(return_value={'retcode': 1,
                                                 'stderr': 'stderr'})}):
            self.assertEqual(logadm.remove('name'),
                             {'Output': 'stderr',
                              'Error': 'Failure in removing log. Possibly\
 already removed?'})

        with patch.dict(logadm.__salt__,
                        {'cmd.run_all':
                         MagicMock(return_value={'retcode': 0,
                                                 'stderr': 'stderr'})}):
            self.assertEqual(logadm.remove('name'), {'Result': 'Success'})