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

1from django.test import TestCase 

2from CIResults.context_processors import global_context 

3 

4import os 

5 

6 

7class global_contextTests(TestCase): 

8 def test_cibuglog(self): 

9 cibuglog = global_context(None)['cibuglog'] 

10 

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) 

16 

17 self.assertIn('freedesktop.org', cibuglog.project_url) 

18 self.assertIn(version, cibuglog.version_url)