~tomasgroth/openlp/portable-path

« back to all changes in this revision

Viewing changes to tests/utils/test_bzr_tags.py

  • Committer: Tomas Groth
  • Date: 2019-04-30 19:02:42 UTC
  • mfrom: (2829.2.32 openlp)
  • Revision ID: tomasgroth@yahoo.dk-20190430190242-6zwjk8724tyux70m
trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
###############################################################################
5
5
# OpenLP - Open Source Lyrics Projection                                      #
6
6
# --------------------------------------------------------------------------- #
7
 
# Copyright (c) 2008-2018 OpenLP Developers                                   #
 
7
# Copyright (c) 2008-2019 OpenLP Developers                                   #
8
8
# --------------------------------------------------------------------------- #
9
9
# This program is free software; you can redistribute it and/or modify it     #
10
10
# under the terms of the GNU General Public License as published by the Free  #
23
23
Package to test for proper bzr tags.
24
24
"""
25
25
import os
26
 
from subprocess import Popen, PIPE
27
 
from unittest import TestCase
 
26
from subprocess import PIPE, Popen
 
27
from unittest import TestCase, SkipTest
 
28
 
28
29
 
29
30
TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10',
30
31
         '1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2',
41
42
        path = os.path.dirname(__file__)
42
43
 
43
44
        # WHEN getting the branches tags
44
 
        bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE)
 
45
        try:
 
46
            bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE)
 
47
        except Exception:
 
48
            raise SkipTest('bzr is not installed')
45
49
        std_out = bzr.communicate()[0]
46
50
        count = len(TAGS1)
47
51
        tags = [line.decode('utf-8').split()[0] for line in std_out.splitlines()]