mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1150818 - Part 1: Output mozinfo into a file. r=ted
This commit is contained in:
parent
8d8917564b
commit
70e8dfe6a4
@ -215,6 +215,11 @@ def find_and_update_from_json(*dirs):
|
||||
|
||||
return None
|
||||
|
||||
def output_to_file(path):
|
||||
import json
|
||||
with open(path, 'w') as f:
|
||||
f.write(json.dumps(info));
|
||||
|
||||
update({})
|
||||
|
||||
# exports
|
||||
@ -227,6 +232,7 @@ __all__ += [
|
||||
'choices',
|
||||
'update',
|
||||
'find_and_update_from_json',
|
||||
'output_to_file',
|
||||
'StringVersion',
|
||||
]
|
||||
|
||||
|
@ -84,6 +84,12 @@ class TestMozinfo(unittest.TestCase):
|
||||
self.assertEqual(mozinfo.find_and_update_from_json(), j)
|
||||
self.assertEqual(mozinfo.info["foo"], "123456")
|
||||
|
||||
def test_output_to_file(self):
|
||||
"""Test that mozinfo.output_to_file works."""
|
||||
path = os.path.join(self.tempdir, "mozinfo.json")
|
||||
mozinfo.output_to_file(path)
|
||||
self.assertEqual(open(path).read(), json.dumps(mozinfo.info))
|
||||
|
||||
|
||||
class TestStringVersion(unittest.TestCase):
|
||||
def test_os_version_is_a_StringVersion(self):
|
||||
|
Loading…
Reference in New Issue
Block a user