diff py/test.py @ 230:185621f47040

run 2to3
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Apr 2015 23:59:16 +0800
parents b32e5a11a4cb
children 74c3ae4e3307
line wrap: on
line diff
--- a/py/test.py	Fri Apr 10 23:55:07 2015 +0800
+++ b/py/test.py	Fri Apr 10 23:59:16 2015 +0800
@@ -1,5 +1,5 @@
 #!/usr/bin/env python2.7
-import StringIO
+import io
 
 import unittest
 import sensor_ds18b20
@@ -50,20 +50,20 @@
             self.params.somewrongthing = 5
 
     def test_params_load(self):
-        jsbuf = StringIO.StringIO('{"fridge_setpoint": 999}')
+        jsbuf = io.StringIO('{"fridge_setpoint": 999}')
 
         self.params.load(f=jsbuf)
         self.assertEqual(self.params.fridge_setpoint, 999)
 
         with self.assertRaises(params.Params.Error):
-            jsbuf = StringIO.StringIO('{"something_else": 999}')
+            jsbuf = io.StringIO('{"something_else": 999}')
             self.params.load(f=jsbuf)
 
         with self.assertRaises(KeyError):
             x = self.params.something_else
 
     def test_params_save(self):
-        jsbuf = StringIO.StringIO()
+        jsbuf = io.StringIO()
 
         self.params.overshoot_delay = 123
         self.params.save(f=jsbuf)