Exemple #1
0
    def test_jobcheck(self):
        """
        Tests for check the job from queue.
        """
        with patch("salt.modules.at.atq", MagicMock(return_value=self.atq_output)):
            self.assertDictEqual(at.jobcheck(), {"error": "You have given a condition"})

            self.assertDictEqual(
                at.jobcheck(runas="foo"),
                {"note": "No match jobs or time format error", "jobs": []},
            )

            self.assertDictEqual(
                at.jobcheck(
                    runas="B", tag="", hour=19, minute=48, day=11, month=12, Year=2014
                ),
                {
                    "jobs": [
                        {
                            "date": "2014-12-11",
                            "job": 101,
                            "queue": "A",
                            "tag": "",
                            "time": "19:48:47",
                            "user": "******",
                        }
                    ]
                },
            )
Exemple #2
0
    def test_jobcheck(self):
        """
        Tests for check the job from queue.
        """
        with patch('salt.modules.at.atq',
                   MagicMock(return_value=self.atq_output)):
            self.assertDictEqual(at.jobcheck(),
                                 {'error': 'You have given a condition'})

            self.assertDictEqual(at.jobcheck(runas='foo'), {
                'note': 'No match jobs or time format error',
                'jobs': []
            })

            self.assertDictEqual(
                at.jobcheck(runas='B',
                            tag='',
                            hour=19,
                            minute=48,
                            day=11,
                            month=12,
                            Year=2014), {
                                'jobs': [{
                                    'date': '2014-12-11',
                                    'job': 101,
                                    'queue': 'A',
                                    'tag': '',
                                    'time': '19:48:47',
                                    'user': '******'
                                }]
                            })
Exemple #3
0
    def test_jobcheck(self):
        """
        Tests for check the job from queue.
        """
        self.assertDictEqual(at.jobcheck(),
                             {'error': 'You have given a condition'})

        self.assertDictEqual(at.jobcheck(runas='foo'),
                             {'note': 'No match jobs or time format error',
                              'jobs': []})

        self.assertDictEqual(at.jobcheck(runas='B', tag='', hour=19, minute=48,
                                         day=11, month=12, Year=2014),
                             {'jobs': [{'date': '2014-12-11',
                                        'job': 101,
                                        'queue': 'A',
                                        'tag': '',
                                        'time': '19:48:47',
                                        'user': '******'}]})