antbob / centos / centpkg

Forked from centos/centpkg a year 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
c0555c
class TestDistGitDirectory(unittest.TestCase):
c0555c
    def test_distgit_emptystring(self):
c0555c
        with self.assertRaises(TypeError):
c0555c
            d = DistGitDirectory()
c0555c
c0555c
    def test_distgit_only_sig(self):
c0555c
        branchstring = 'sig-cloud7'
c0555c
        d = DistGitDirectory(branchstring)
c0555c
c0555c
        self.assertEqual(d.signame, 'cloud')
c0555c
        self.assertEqual(d.centosversion, '7')
c0555c
        self.assertEqual(d.projectname, None)
c0555c
        self.assertEqual(d.releasename, None)
c0555c
c0555c
    def test_distgit_sig_and_project(self):
c0555c
        branchstring = 'sig-cloud7-openstack'
c0555c
        d = DistGitDirectory(branchstring)
c0555c
c0555c
        self.assertEqual(d.signame, 'cloud')
c0555c
        self.assertEqual(d.centosversion, '7')
c0555c
        self.assertEqual(d.projectname, 'openstack')
c0555c
        self.assertEqual(d.releasename, None)
c0555c
c0555c
    def test_distgit_sig_project_and_release(self):
c0555c
        branchstring = 'sig-cloud7-openstack-kilo'
c0555c
        d = DistGitDirectory(branchstring)
c0555c
c0555c
        self.assertEqual(d.signame, 'cloud')
c0555c
        self.assertEqual(d.centosversion, '7')
c0555c
        self.assertEqual(d.projectname, 'openstack')
c0555c
        self.assertEqual(d.releasename, 'kilo')
c0555c