~larry-e-works/uci-engine/amqp-to-kombu

« back to all changes in this revision

Viewing changes to cupstream2distro/tests/unit/test_packageinppamanager.py

  • Committer: Francis Ginther
  • Date: 2014-06-10 20:42:46 UTC
  • mto: This revision was merged to the branch mainline in revision 571.
  • Revision ID: francis.ginther@canonical.com-20140610204246-b1bsrik7nlcolqy7
Import lp:cupstream2distro rev 605.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Copyright: (C) 2013 Canonical
 
3
#
 
4
# Authors:
 
5
#  Didier Roche
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify it under
 
8
# the terms of the GNU General Public License as published by the Free Software
 
9
# Foundation; version 3.
 
10
#
 
11
# This program is distributed in the hope that it will be useful, but WITHOUT
 
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
13
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
14
# details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along with
 
17
# this program; if not, write to the Free Software Foundation, Inc.,
 
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
19
 
 
20
from . import BaseUnitTestCase
 
21
 
 
22
from cupstream2distro import packageinppamanager
 
23
 
 
24
import os
 
25
import shutil
 
26
 
 
27
 
 
28
class PackageInPPAManagerTests(BaseUnitTestCase):
 
29
 
 
30
    def test_get_current_distro_version_from_config(self):
 
31
        '''We load and return the current package version from config'''
 
32
        shutil.copy2(os.path.join(self.project_file_dir, 'foo.project'), '.')
 
33
        self.assertEquals(packageinppamanager._get_current_packaging_version_from_config('foo'), '6.12.0daily13.02.27-0ubuntu1')
 
34
 
 
35
    def test_get_current_return_from_config(self):
 
36
        '''We load and return the current tip rev from config'''
 
37
        shutil.copy2(os.path.join(self.project_file_dir, 'foo.project'), '.')
 
38
        self.assertEquals(packageinppamanager._get_current_rev_from_config('foo'), '42')