11
from canonical.lucille.tests.util import dist, drs
11
from canonical.archivepublisher.tests.util import dist, drs
13
13
class TestConfig(unittest.TestCase):
15
15
def testImport(self):
16
"""canonical.lucille.Config should be importable"""
17
from canonical.lucille import Config
16
"""canonical.archivepublisher.Config should be importable"""
17
from canonical.archivepublisher import Config
19
19
def testInstantiate(self):
20
"""canonical.lucille.Config should instantiate"""
21
from canonical.lucille import Config
20
"""canonical.archivepublisher.Config should instantiate"""
21
from canonical.archivepublisher import Config
22
22
d = Config(dist, drs)
24
24
def testDistroName(self):
25
"""canonical.lucille.Config should be able to return the distroName"""
26
from canonical.lucille import Config
25
"""canonical.archivepublisher.Config should be able to return the distroName"""
26
from canonical.archivepublisher import Config
27
27
d = Config(dist, drs)
28
28
self.assertEqual( d.distroName, "ubuntu" )
30
30
def testDistroReleaseNames(self):
31
"""canonical.lucille.Config should return two distrorelease names"""
32
from canonical.lucille import Config
31
"""canonical.archivepublisher.Config should return two distrorelease names"""
32
from canonical.archivepublisher import Config
33
33
d = Config(dist, drs)
34
34
drns = d.distroReleaseNames()
35
35
self.assertEquals( len(drns), 2 )
41
41
self.assertEquals( drns[1], "hoary" )
43
43
def testArchTagsForRelease(self):
44
"""canonical.lucille.Config should have the arch tags for the drs"""
45
from canonical.lucille import Config
44
"""canonical.archivepublisher.Config should have the arch tags for the drs"""
45
from canonical.archivepublisher import Config
46
46
d = Config(dist, drs)
47
47
archs = d.archTagsForRelease( "hoary" )
48
48
self.assertEquals( len(archs), 2 )
50
50
def testDistroConfig(self):
51
"""canonical.lucille.Config should have parsed a distro config"""
52
from canonical.lucille import Config
51
"""canonical.archivepublisher.Config should have parsed a distro config"""
52
from canonical.archivepublisher import Config
53
53
d = Config(dist, drs)
54
54
# NOTE: Add checks here when you add stuff in util.py
55
55
self.assertEquals( d.stayofexecution, 5 )