Esempio n. 1
0
    def test_already_exists(self):
        """Test when sha already exists."""
        self.mock.sha_exists.return_value = True
        binary_providers.ensure_sha('sha', 'source')

        self.mock.sha_exists.assert_called_once_with('sha', 'source')
        self.assertEqual(0, self.mock.execute.call_count)
Esempio n. 2
0
    def test_not_exists(self):
        """Test when sha doesn't exists."""
        self.mock.sha_exists.return_value = False
        binary_providers.ensure_sha('sha', 'source')

        self.mock.sha_exists.assert_called_once_with('sha', 'source')
        self.mock.execute.assert_called_once_with('git', 'fetch origin sha',
                                                  'source')