Exemple #1
0
    def test_atc(self):
        """
        Tests for atc
        """
        with patch.object(at, "_cmd", return_value=None):
            self.assertEqual(at.atc(101), "'at.atc' is not available.")

        with patch.object(at, "_cmd", return_value=""):
            self.assertDictEqual(at.atc(101), {"error": "invalid job id '101'"})

        with patch.object(at, "_cmd", return_value="101\tThu Dec 11 19:48:47 2014 A B"):
            self.assertEqual(at.atc(101), "101\tThu Dec 11 19:48:47 2014 A B")
Exemple #2
0
    def test_atc(self):
        """
            Tests for atc
        """
        with patch.object(at, '_cmd', return_value=None):
            self.assertEqual(at.atc(101), '\'at.atc\' is not available.')

        with patch.object(at, '_cmd', return_value=''):
            self.assertDictEqual(at.atc(101), {'error': 'invalid job id 101'})

        with patch.object(at, '_cmd',
                          return_value='101\tThu Dec 11 19:48:47 2014 A B'):
            self.assertEqual(at.atc(101), '101\tThu Dec 11 19:48:47 2014 A B')
Exemple #3
0
    def test_atc(self):
        """
            Tests for atc
        """
        with patch.object(at, '_cmd', return_value=None):
            self.assertEqual(at.atc(101), '\'at.atc\' is not available.')

        with patch.object(at, '_cmd', return_value=''):
            self.assertDictEqual(at.atc(101),
                                 {'error': 'invalid job id \'101\''})

        with patch.object(at, '_cmd',
                          return_value='101\tThu Dec 11 19:48:47 2014 A B'):
            self.assertEqual(at.atc(101), '101\tThu Dec 11 19:48:47 2014 A B')