def test_present(self):
        name = 'jboss'
        timespec = '9:09 11/04/15'
        tag = 'love'
        user = 'jam'

        ret = {'name': name,
               'result': True,
               'changes': {},
               'comment': ''}

        mock = MagicMock(return_value=False)
        with patch.dict(at.__opts__, {'test': False}):
            with patch.dict(at.__grains__, {'os_family': 'Redhat'}):
                with patch.dict(at.__salt__, {'cmd.run': mock}):
                    ret.update({'comment': False})
                    self.assertDictEqual(at.present(name, timespec, tag),
                                         ret)

                with patch.dict(at.__salt__, {'user.info': mock}):
                    comt = 'User: {0} is not exists'.format(user)
                    ret.update({'comment': comt, 'result': False})
                    self.assertDictEqual(at.present(name, timespec, tag, user),
                                         ret)

        with patch.dict(at.__opts__, {'test': True}):
            comt = 'job {0} is add and will run on {1}'.format(name, timespec)
            ret.update({'comment': comt, 'result': None})
            self.assertDictEqual(at.present(name, timespec, tag, user), ret)

    # 'absent' function tests: 1
Test to add a job to queue.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/at_test.py/AtTestCase.test_present