~doxxx/+junk/bzr-release-config

« back to all changes in this revision

Viewing changes to tests/test_releaseconfig.py

  • Committer: Gordon Tyler
  • Date: 2010-10-12 01:06:51 UTC
  • Revision ID: gordon@doxxx.net-20101012010651-q0netr4z0qcxsg4q
Added test for overrides and switched branch fetching test to smaller branch that's quicker to fetch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
class Parsing(TestCase):
27
27
    def test_platform_names(self):
28
28
        rcs = ReleaseConfigs.from_file(TEST_INI)
29
 
        self.assertEquals(['mac-10.6'], rcs.get_platform_names())
 
29
        self.assertEquals(['mac-10.6', 'win32'],
 
30
            sorted(rcs.get_platform_names()))
30
31
 
31
32
    def test_platform(self):
32
33
        rcs = ReleaseConfigs.from_file(TEST_INI)
33
 
        rc = rcs. get_config_for_platform('mac-10.6')
 
34
        rc = rcs.get_config_for_platform('mac-10.6')
34
35
        self.assertEquals(
35
36
            ['bzr','launchpadlib','paramiko','pycrypto','pyqt','sip',
36
37
             'subvertpy'],
43
44
    
44
45
    def test_package(self):
45
46
        rcs = ReleaseConfigs.from_file(TEST_INI)
46
 
        rc = rcs. get_config_for_platform('mac-10.6')
 
47
        rc = rcs.get_config_for_platform('mac-10.6')
47
48
        pkg = rc.packages['bzr']
48
49
        self.assertEquals('bzr', pkg.name)
49
50
        self.assertEquals('http://launchpad.net/bzr/2.2/2.2b3/+download/bzr-2.2b3.tar.gz',
52
53
        self.assertEquals('bzrtools', plugin.name)
53
54
        self.assertEquals('tip', plugin.revno)
54
55
        self.assertEquals('lp:bzrtools', plugin.branch)
 
56
    
 
57
    def test_override(self):
 
58
        rcs = ReleaseConfigs.from_file(TEST_INI)
 
59
        rc = rcs.get_config_for_platform('mac-10.6')
 
60
        pkg = rc.packages['subvertpy']
 
61
        self.assertEquals('lp:subvertpy', pkg.branch)
 
62
        rc = rcs.get_config_for_platform('win32')
 
63
        pkg = rc.packages['subvertpy']
 
64
        self.assertEquals('http://launchpad.net/subvertpy/trunk/0.7.4/+download/subvertpy-0.7.4.tar.gz',
 
65
                          pkg.url)
55
66
 
56
67
 
57
68
class Fetching(TestCase):
77
88
    def test_fetch_branch(self):
78
89
        rcs = ReleaseConfigs.from_file(TEST_INI)
79
90
        rc = rcs. get_config_for_platform('mac-10.6')
80
 
        pkg = rc.plugins['bzrtools']
 
91
        pkg = rc.plugins['keychain']
81
92
        pkg.fetch(self.cache_dir, self.temp_dir)
82
 
        self.assertTrue(os.path.exists(os.path.join(self.temp_dir,'bzrtools')))
83
 
        self.assertTrue(os.path.isdir(os.path.join(self.temp_dir,'bzrtools')))
 
93
        self.assertTrue(os.path.exists(os.path.join(self.temp_dir,'keychain')))
 
94
        self.assertTrue(os.path.isdir(os.path.join(self.temp_dir,'keychain')))