~curtin-dev/curtin/bionic

« back to all changes in this revision

Viewing changes to tests/unittests/test_version.py

  • Committer: Scott Moser
  • Date: 2017-08-03 19:51:16 UTC
  • mfrom: (1.1.50)
  • Revision ID: smoser@ubuntu.com-20170803195116-0xc6onji18peerm5
* New upstream snapshot.
  - tests: Add CiTestCase common parent for all curtin tests.
  - vmtests: Remove force flag for centos curthooks
  - tools/jenkins-runner: improve tgtd cleanup logic
  - tests: Drop EOL Wily Vivid and Yakkety tests.
  - Disable yum plugins when installing packages, update ca-certs for https
  - Rename centos_network_curthooks -> centos_apply_network_config.
  - tests: in centos_defaults use write_files for grub serial.
  - write_files: write files after extract, change write_files signature.
  - pass network configuration through to target for ubuntu and centos
  - tests: disable yakkety tests.
  - tools/launch: automatically pass on proxy settings to curtin
  - Add top level 'proxy' to config, deprecate top level http_proxy.
  - tools/curtainer: fix to enable deb-src for -proposed.
  - Use unshare to put chroot commands in own pid namespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from unittest import TestCase
2
1
import mock
3
2
import subprocess
4
3
import os
5
4
 
6
5
from curtin import version
7
6
from curtin import __version__ as old_version
8
 
 
9
 
 
10
 
class CurtinVersionBase(TestCase):
11
 
    def setUp(self):
12
 
        super(CurtinVersionBase, self).setUp()
13
 
 
14
 
    def add_patch(self, target, attr):
15
 
        """Patches specified target object and sets it as attr on test
16
 
        instance also schedules cleanup"""
17
 
        m = mock.patch(target, autospec=True)
18
 
        p = m.start()
19
 
        self.addCleanup(m.stop)
20
 
        setattr(self, attr, p)
21
 
 
22
 
 
23
 
class TestCurtinVersion(CurtinVersionBase):
24
 
 
25
 
    def setUp(self):
 
7
from .helpers import CiTestCase
 
8
 
 
9
 
 
10
class TestCurtinVersion(CiTestCase):
 
11
 
 
12
    def setUp(self):
 
13
        super(TestCurtinVersion, self).setUp()
26
14
        self.add_patch('subprocess.check_output', 'mock_subp')
27
15
        self.add_patch('os.path', 'mock_path')
28
16