File tree Expand file tree Collapse file tree
ietf/utils/management/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+ import tempfile
3+
14from django .core .management import call_command
25from django .test import TestCase
36from django .utils .six import StringIO
710class CoverageChangeTestCase (TestCase ):
811
912 def test_coverage_change (self ):
10- master = StringIO (
11- """{
13+ master_txt = """{
1214 "5.12.0": {
1315 "code": {
1416 "coverage": 0.5921474057048117,
@@ -40,9 +42,8 @@ def test_coverage_change(self):
4042 },
4143 "version": "5.12.0"
4244 }
43- """ )
44- latest = StringIO (
45- """{
45+ """
46+ latest_txt = """{
4647 "latest": {
4748 "code": {
4849 "coverage": 0.5921474057048117,
@@ -74,11 +75,19 @@ def test_coverage_change(self):
7475 },
7576 "version":"latest"
7677 }
77- """ )
78+ """
79+ mfh , master = tempfile .mkstemp (suffix = '.json' )
80+ with open (master , "w" ) as file :
81+ file .write (master_txt )
82+ lfh , latest = tempfile .mkstemp (suffix = '.json' )
83+ with open (latest , "w" ) as file :
84+ file .write (latest_txt )
7885 output = StringIO ()
7986 call_command ('coverage_changes' , master , latest , stdout = output )
8087 text = output .getvalue ()
81-
88+ os .unlink (master )
89+ os .unlink (latest )
90+
8291 for l in [
8392 r"admin/group/group/change_form.html False True" ,
8493 r"^api/v1/?$ True False" ,
You can’t perform that action at this time.
0 commit comments