Coverage for CIResults/tests/test_context_processors.py: 100%
13 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-19 09:20 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-19 09:20 +0000
1from django.test import TestCase
2from CIResults.context_processors import global_context
4import os
7class global_contextTests(TestCase):
8 def test_cibuglog(self):
9 cibuglog = global_context(None)['cibuglog']
11 version = 'Hello world'
12 os.environ.pop('CIBUGLOG_VERSION', None)
13 self.assertEqual(cibuglog.version, None)
14 os.environ['CIBUGLOG_VERSION'] = version
15 self.assertEqual(cibuglog.version, version)
17 self.assertIn('freedesktop.org', cibuglog.project_url)
18 self.assertIn(version, cibuglog.version_url)