Ejemplo n.º 1
0
    def test_revision(self):
        '''
        Test for Returns the long hash of a given identifier
        '''
        mock = MagicMock(side_effect=[{'retcode': 0, 'stdout': 'A'},
                                        {'retcode': 1, 'stdout': 'A'}])
        with patch.dict(hg.__salt__, {'cmd.run_all': mock}):
            self.assertEqual(hg.revision('cwd'), 'A')

            self.assertEqual(hg.revision('cwd'), '')
Ejemplo n.º 2
0
    def test_revision(self):
        '''
        Test for Returns the long hash of a given identifier
        '''
        mock = MagicMock(side_effect=[{'retcode': 0, 'stdout': 'A'},
                                        {'retcode': 1, 'stdout': 'A'}])
        with patch.dict(hg.__salt__, {'cmd.run_all': mock}):
            self.assertEqual(hg.revision('cwd'), 'A')

            self.assertEqual(hg.revision('cwd'), '')
Ejemplo n.º 3
0
    def test_revision(self):
        """
        Test for Returns the long hash of a given identifier
        """
        mock = MagicMock(side_effect=[{
            "retcode": 0,
            "stdout": "A"
        }, {
            "retcode": 1,
            "stdout": "A"
        }])
        with patch.dict(hg.__salt__, {"cmd.run_all": mock}):
            self.assertEqual(hg.revision("cwd"), "A")

            self.assertEqual(hg.revision("cwd"), "")