bstinson / centos / centpkg

Forked from centos/centpkg 3 years 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
47c4aa
    def test_target_gets_set(self):
47c4aa
        self.assertEqual(self.d.target, 'cloud7-common-el7')
47c4aa
3a7531
class TestDistgitSigAndCommon(unittest.TestCase):
3a7531
    def setUp(self):
3a7531
        self.branchstring = 'sig-cloud7-common'
3a7531
        self.d = DistGitDirectory(self.branchstring)
3a7531
3a7531
    def test_signame_gets_set(self):
3a7531
        self.assertEqual(self.d.signame, 'cloud')
3a7531
3a7531
    def test_centosversion_gets_set(self):
3a7531
        self.assertEqual(self.d.centosversion, '7')
3a7531
3a7531
    def test_projectname_gets_set(self):
3a7531
        self.assertEqual(self.d.projectname, None)
3a7531
3a7531
    def test_releasename_gets_set(self):
3a7531
        self.assertEqual(self.d.releasename, None)
3a7531
3a7531
    def test_target_gets_set(self):
3a7531
        self.assertEqual(self.d.target, 'cloud7-common-el7')
3a7531
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
f7e2af
    def test_target_gets_set(self):
f7e2af
        self.assertEqual(self.d.target, 'cloud7-openstack-common-el7')
f7e2af
3a7531
class TestDistgitSigProjectAndCommon(unittest.TestCase):
3a7531
    def setUp(self):
3a7531
        self.branchstring = 'sig-cloud7-openstack-common'
3a7531
        self.d = DistGitDirectory(self.branchstring)
3a7531
3a7531
    def test_signame_gets_set(self):
3a7531
        self.assertEqual(self.d.signame, 'cloud')
3a7531
3a7531
    def test_centosversion_gets_set(self):
3a7531
        self.assertEqual(self.d.centosversion, '7')
3a7531
3a7531
    def test_projectname_gets_set(self):
3a7531
        self.assertEqual(self.d.projectname, 'openstack')
3a7531
3a7531
    def test_releasename_gets_set(self):
3a7531
        self.assertEqual(self.d.releasename, None)
3a7531
3a7531
    def test_target_gets_set(self):
3a7531
        self.assertEqual(self.d.target, 'cloud7-openstack-common-el7')
3a7531
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')
c8beba
c8beba
    def test_target_gets_set(self):
c8beba
        self.assertEqual(self.d.target, 'cloud7-openstack-kilo-el7')
c8beba