def test_present(self):
        ret = [{'changes': {}, 'comment': 'Raid salt already present',
                'name': 'salt', 'result': True},
               {'changes': {},
                'comment': "Devices are a mix of RAID constituents"
                " (['dev0']) and non-RAID-constituents(['dev1']).",
                'name': 'salt', 'result': False},
               {'changes': {},
                'comment': 'Raid will be created with: True', 'name': 'salt',
                'result': None},
               {'changes': {}, 'comment': 'Raid salt failed to be created.',
                'name': 'salt', 'result': False}]

        mock = MagicMock(side_effect=[{'salt': True}, {'salt': False},
                                      {'salt': False}, {'salt': False},
                                      {'salt': False}])
        with patch.dict(mdadm.__salt__, {'raid.list': mock}):
            self.assertEqual(mdadm.present("salt", 5, "dev0"), ret[0])

            mock = MagicMock(side_effect=[0, 1])
            with patch.dict(mdadm.__salt__, {'cmd.retcode': mock}):
                self.assertDictEqual(mdadm.present("salt", 5,
                                                   ["dev0", "dev1"]),
                                     ret[1])

            mock = MagicMock(return_value=True)
            with patch.dict(mdadm.__salt__, {'cmd.retcode': mock}):
                with patch.dict(mdadm.__opts__, {'test': True}):
                    with patch.dict(mdadm.__salt__, {'raid.create': mock}):
                        self.assertDictEqual(mdadm.present("salt", 5, "dev0"),
                                             ret[2])

                with patch.dict(mdadm.__opts__, {'test': False}):
                    with patch.dict(mdadm.__salt__, {'raid.create': mock}):
                        self.assertDictEqual(mdadm.present("salt", 5, "dev0"),
                                             ret[3])
wrapper for _run, application instance added
dataset/ETHPy150Open saltstack/salt/tests/unit/states/mdadm_test.py/MdadmTestCase.test_present--crossover with--dataset/ETHPy150Open selfsk/nodeset.core/src/nodeset/common/twistedapi.py/run