示例#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'), '')
示例#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'), '')
示例#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"), "")