Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / dulwich / contrib / test_release_robot.py @ 959

History | View | Annotate | Download (1.47 KB)

1
# release_robot.py
2
#
3
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
4
# General Public License as public by the Free Software Foundation; version 2.0
5
# or (at your option) any later version. You can redistribute it and/or
6
# modify it under the terms of either of these two licenses.
7
#
8
# Unless required by applicable law or agreed to in writing, software
9
# distributed under the License is distributed on an "AS IS" BASIS,
10
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
# See the License for the specific language governing permissions and
12
# limitations under the License.
13
#
14
# You should have received a copy of the licenses; if not, see
15
# <http://www.gnu.org/licenses/> for a copy of the GNU General Public License
16
# and <http://www.apache.org/licenses/LICENSE-2.0> for a copy of the Apache
17
# License, Version 2.0.
18
#
19

    
20
"""Tests for release_robot."""
21

    
22
import re
23
import unittest
24

    
25
from dulwich.contrib.release_robot import PATTERN
26

    
27

    
28
class TagPatternTests(unittest.TestCase):
29

    
30
    def test_tag_pattern(self):
31
        test_cases = {
32
            '0.3': '0.3', 'v0.3': '0.3', 'release0.3': '0.3', 'Release-0.3': '0.3',
33
            'v0.3rc1': '0.3rc1', 'v0.3-rc1': '0.3-rc1', 'v0.3-rc.1': '0.3-rc.1',
34
            'version 0.3': '0.3', 'version_0.3_rc_1': '0.3_rc_1', 'v1': '1',
35
            '0.3rc1': '0.3rc1'
36
        }
37
        for tc, version in test_cases.items():
38
            m = re.match(PATTERN, tc)
39
            self.assertEqual(m.group(1), version)