Example #1
0
    def test_discover(self):
        # Test: Mocking no services configured
        ci_discoverer_mock = CiDiscoverer()
        ci_discoverer_mock.services = None

        self.assertRaises(Exception, ci_discoverer_mock.discover, path='')

        # Test: Project with Travis CI
        self.assertTrue(self.ci_discoverer.discover(
            os.path.join(REPOS_PATH, 'squib')
        ))

        # Test: Project with AppVeyor
        self.assertTrue(self.ci_discoverer.discover(
            os.path.join(REPOS_PATH, 'grunt')
        ))

        # Test: Project with both Travis CI and AppVeyor
        self.assertTrue(self.ci_discoverer.discover(
            os.path.join(REPOS_PATH, 'grunt')
        ))

        # Test: Project with no CI (when these tests were written)
        self.assertFalse(self.ci_discoverer.discover(
            os.path.join(REPOS_PATH, 'django')
        ))
Example #2
0
    def test_discover(self):
        # Test: Mocking no services configured
        ci_discoverer_mock = CiDiscoverer()
        ci_discoverer_mock.services = None

        self.assertRaises(Exception, ci_discoverer_mock.discover, path='')

        # Test: Project with Travis CI
        self.assertTrue(
            self.ci_discoverer.discover(os.path.join(REPOS_PATH, 'squib')))

        # Test: Project with AppVeyor
        self.assertTrue(
            self.ci_discoverer.discover(os.path.join(REPOS_PATH, 'grunt')))

        # Test: Project with both Travis CI and AppVeyor
        self.assertTrue(
            self.ci_discoverer.discover(os.path.join(REPOS_PATH, 'grunt')))

        # Test: Project with no CI (when these tests were written)
        self.assertFalse(
            self.ci_discoverer.discover(os.path.join(REPOS_PATH, 'django')))