def setupMozinfoJS(self): local = tempfile.mktemp() mozinfo.output_to_file(local) mozInfoJSPath = remoteJoin(self.profileDir, "mozinfo.json") self.device.pushFile(local, mozInfoJSPath) os.remove(local) return mozInfoJSPath
def setupMozinfoJS(self): local = tempfile.mktemp() mozinfo.output_to_file(local) mozInfoJSPath = posixpath.join(self.profileDir, "mozinfo.json") self.device.push(local, mozInfoJSPath) self.device.chmod(mozInfoJSPath, root=True) os.remove(local) return mozInfoJSPath
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))