

from unittest import TestCase, main
from companies import YourCompany


class TestYourCompany(TestCase):

    def setUp(self):
        self.company = YourCompany()

    def testDeveloperTesting(self):
        """Unit tests (this probably goes without saying)"""
        self.assertTrue(self.company.unittests_code())

    def testCodeReviewsPerformedRegularly(self):
        """Because four eyes are better than two"""
        self.assertTrue(2 < self.company.eyes_on_code())
        self.assertTrue(2 >= self.company.average_employee_eye_count())

    def testHaveAContinuousBuild(self):
        """An email goes out if someone breaks it"""
        # Bonus if there's a fun broadcast of the status,
        # like say a police siren
        self.assertTrue(self.company.has_a_continuous_build())

    def testSourceControl(self):
        """Such as svn, hg, etc"""
        self.assertTrue(self.company.has_system("Source Control"))

    def testDefectTracking(self):
        """Such as trac, bugzilla, jira"""
        self.assertTrue(self.company.has_system("Defect Tracking"))

    def testDevelopersChooseTheirOwnEnvironment(self):
        """I prefer gnu emacs, but that really shouldn't matter"""
        self.assertTrue(self.company.can_use_editor("GNU Emacs"))

if __name__ == '__main__':
    main()
