mfocko / centos / centpkg

Forked from centos/centpkg 5 months ago
Clone

Blame tests/test_distgit.py

c0555c
import os
c0555c
import sys
c0555c
import unittest
c0555c
c0555c
c0555c
print sys.path
c0555c
c0555c
from centpkg import DistGitDirectory
c0555c
b9126c
class TestDistGitNothing(unittest.TestCase):
c0555c
    def test_distgit_emptystring(self):
c0555c
        with self.assertRaises(TypeError):
c0555c
            d = DistGitDirectory()
c0555c
b9126c
class TestDistgitOnlySig(unittest.TestCase):
b9126c
    def setUp(self):
b9126c
        self.branchstring = 'sig-cloud7'
b9126c
        self.d = DistGitDirectory(self.branchstring)
c0555c
b9126c
    def test_signame_gets_set(self):
b9126c
        self.assertEqual(self.d.signame, 'cloud')
c0555c
b9126c
    def test_centosversion_gets_set(self):
b9126c
        self.assertEqual(self.d.centosversion, '7')
c0555c
b9126c
    def test_projectname_gets_set(self):
b9126c
        self.assertEqual(self.d.projectname, None)
c0555c
b9126c
    def test_releasename_gets_set(self):
b9126c
        self.assertEqual(self.d.releasename, None)
c0555c
b9126c
class TestDistgitSigAndProject(unittest.TestCase):
b9126c
    def setUp(self):
b9126c
        self.branchstring = 'sig-cloud7-openstack'
b9126c
        self.d = DistGitDirectory(self.branchstring)
c0555c
b9126c
    def test_signame_gets_set(self):
b9126c
        self.assertEqual(self.d.signame, 'cloud')
b9126c
b9126c
    def test_centosversion_gets_set(self):
b9126c
        self.assertEqual(self.d.centosversion, '7')
b9126c
b9126c
    def test_projectname_gets_set(self):
b9126c
        self.assertEqual(self.d.projectname, 'openstack')
b9126c
b9126c
    def test_releasename_gets_set(self):
b9126c
        self.assertEqual(self.d.releasename, None)
b9126c
b9126c
class TestDistgitSigProjectAndRelease(unittest.TestCase):
b9126c
    def setUp(self):
b9126c
        self.branchstring = 'sig-cloud7-openstack-kilo'
b9126c
        self.d = DistGitDirectory(self.branchstring)
b9126c
b9126c
    def test_signame_gets_set(self):
b9126c
        self.assertEqual(self.d.signame, 'cloud')
b9126c
b9126c
    def test_centosversion_gets_set(self):
b9126c
        self.assertEqual(self.d.centosversion, '7')
b9126c
b9126c
    def test_projectname_gets_set(self):
b9126c
        self.assertEqual(self.d.projectname, 'openstack')
b9126c
b9126c
    def test_releasename_gets_set(self):
b9126c
        self.assertEqual(self.d.releasename, 'kilo')