@@ -85,58 +85,58 @@ def test_version(self):
8585 from Arduino .arduino import build_cmd_str
8686 expected_version = "version"
8787 self .mock_serial .push_line (expected_version )
88- self .assertEquals (self .board .version (), expected_version )
89- self .assertEquals (self .mock_serial .output [0 ], build_cmd_str ('version' ))
88+ self .assertEqual (self .board .version (), expected_version )
89+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) , build_cmd_str ('version' ))
9090
9191 def test_pinMode_input (self ):
9292 from Arduino .arduino import build_cmd_str
9393 pin = 9
9494 self .board .pinMode (pin , INPUT )
95- self .assertEquals (self .mock_serial .output [0 ],
95+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
9696 build_cmd_str ('pm' , (- pin ,)))
9797
9898 def test_pinMode_output (self ):
9999 from Arduino .arduino import build_cmd_str
100100 pin = 9
101101 self .board .pinMode (pin , OUTPUT )
102- self .assertEquals (self .mock_serial .output [0 ],
102+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
103103 build_cmd_str ('pm' , (pin ,)))
104104
105105 def test_pulseIn_low (self ):
106106 from Arduino .arduino import build_cmd_str
107107 expected_duration = 230
108108 self .mock_serial .push_line (expected_duration )
109109 pin = 9
110- self .assertEquals (self .board .pulseIn (pin , LOW ), expected_duration )
111- self .assertEquals (self .mock_serial .output [0 ],
110+ self .assertEqual (self .board .pulseIn (pin , LOW ), expected_duration )
111+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
112112 build_cmd_str ('pi' , (- pin ,)))
113113
114114 def test_pulseIn_high (self ):
115115 from Arduino .arduino import build_cmd_str
116116 expected_duration = 230
117117 pin = 9
118118 self .mock_serial .push_line (expected_duration )
119- self .assertEquals (self .board .pulseIn (pin , HIGH ), expected_duration )
120- self .assertEquals (self .mock_serial .output [0 ], build_cmd_str ('pi' , (pin ,)))
119+ self .assertEqual (self .board .pulseIn (pin , HIGH ), expected_duration )
120+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) , build_cmd_str ('pi' , (pin ,)))
121121
122122 def test_digitalRead (self ):
123123 from Arduino .arduino import build_cmd_str
124124 pin = 9
125125 self .mock_serial .push_line (READ_LOW )
126- self .assertEquals (self .board .digitalRead (pin ), READ_LOW )
127- self .assertEquals (self .mock_serial .output [0 ], build_cmd_str ('dr' , (pin ,)))
126+ self .assertEqual (self .board .digitalRead (pin ), READ_LOW )
127+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) , build_cmd_str ('dr' , (pin ,)))
128128
129129 def test_digitalWrite_low (self ):
130130 from Arduino .arduino import build_cmd_str
131131 pin = 9
132132 self .board .digitalWrite (pin , LOW )
133- self .assertEquals (self .mock_serial .output [0 ], build_cmd_str ('dw' , (- pin ,)))
133+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) , build_cmd_str ('dw' , (- pin ,)))
134134
135135 def test_digitalWrite_high (self ):
136136 from Arduino .arduino import build_cmd_str
137137 pin = 9
138138 self .board .digitalWrite (pin , HIGH )
139- self .assertEquals (self .mock_serial .output [0 ], build_cmd_str ('dw' , (pin ,)))
139+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) , build_cmd_str ('dw' , (pin ,)))
140140
141141 def test_melody (self ):
142142 from Arduino .arduino import build_cmd_str
@@ -145,9 +145,9 @@ def test_melody(self):
145145 duration = 4
146146 C4_NOTE = 262
147147 self .board .Melody (pin , notes , [duration ])
148- self .assertEquals (self .mock_serial .output [0 ],
148+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
149149 build_cmd_str ('to' , (len (notes ), pin , C4_NOTE , duration )))
150- self .assertEquals (self .mock_serial .output [1 ],
150+ self .assertEqual (self .mock_serial .output [1 ]. decode ( 'UTF-8' ) ,
151151 build_cmd_str ('nto' , (pin ,)))
152152
153153 def test_shiftIn (self ):
@@ -157,9 +157,9 @@ def test_shiftIn(self):
157157 pinOrder = MSBFIRST
158158 expected = 0xff
159159 self .mock_serial .push_line (expected )
160- self .assertEquals (self .board .shiftIn (dataPin , clockPin , pinOrder ),
160+ self .assertEqual (self .board .shiftIn (dataPin , clockPin , pinOrder ),
161161 expected )
162- self .assertEquals (self .mock_serial .output [0 ],
162+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
163163 build_cmd_str ('si' , (dataPin , clockPin , pinOrder ,)))
164164
165165 def test_shiftOut (self ):
@@ -169,24 +169,24 @@ def test_shiftOut(self):
169169 pinOrder = MSBFIRST
170170 value = 0xff
171171 self .board .shiftOut (dataPin , clockPin , pinOrder , value )
172- self .assertEquals (self .mock_serial .output [0 ],
172+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
173173 build_cmd_str ('so' , (dataPin , clockPin , pinOrder , value )))
174174
175175 def test_analogRead (self ):
176176 from Arduino .arduino import build_cmd_str
177177 pin = 9
178178 expected = 1023
179179 self .mock_serial .push_line (expected )
180- self .assertEquals (self .board .analogRead (pin ), expected )
181- self .assertEquals (self .mock_serial .output [0 ],
180+ self .assertEqual (self .board .analogRead (pin ), expected )
181+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
182182 build_cmd_str ('ar' , (pin ,)))
183183
184184 def test_analogWrite (self ):
185185 from Arduino .arduino import build_cmd_str
186186 pin = 9
187187 value = 255
188188 self .board .analogWrite (pin , value )
189- self .assertEquals (self .mock_serial .output [0 ],
189+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
190190 build_cmd_str ('aw' , (pin , value )))
191191
192192
@@ -200,7 +200,7 @@ def test_attach(self):
200200 servo_min = 544
201201 servo_max = 2400
202202 self .board .Servos .attach (pin , min = servo_min , max = servo_max )
203- self .assertEquals (self .mock_serial .output [0 ],
203+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
204204 build_cmd_str ('sva' , (pin , servo_min , servo_max )))
205205
206206 def test_detach (self ):
@@ -212,7 +212,7 @@ def test_detach(self):
212212 self .board .Servos .attach (pin )
213213 self .mock_serial .reset_mock ()
214214 self .board .Servos .detach (pin )
215- self .assertEquals (self .mock_serial .output [0 ],
215+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
216216 build_cmd_str ('svd' , (position ,)))
217217
218218 def test_write (self ):
@@ -225,7 +225,7 @@ def test_write(self):
225225 self .board .Servos .attach (pin )
226226 self .mock_serial .reset_mock ()
227227 self .board .Servos .write (pin , angle )
228- self .assertEquals (self .mock_serial .output [0 ],
228+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
229229 build_cmd_str ("svw" , (position , angle )))
230230
231231 def test_writeMicroseconds (self ):
@@ -238,7 +238,7 @@ def test_writeMicroseconds(self):
238238 self .board .Servos .attach (pin )
239239 self .mock_serial .reset_mock ()
240240 self .board .Servos .writeMicroseconds (pin , microseconds )
241- self .assertEquals (self .mock_serial .output [0 ],
241+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
242242 build_cmd_str ("svwm" , (position , microseconds )))
243243
244244 def test_read (self ):
@@ -251,8 +251,8 @@ def test_read(self):
251251 self .board .Servos .attach (pin )
252252 self .mock_serial .reset_mock ()
253253 self .mock_serial .push_line (angle )
254- self .assertEquals (self .board .Servos .read (pin ), angle )
255- self .assertEquals (self .mock_serial .output [0 ],
254+ self .assertEqual (self .board .Servos .read (pin ), angle )
255+ self .assertEqual (self .mock_serial .output [0 ]. decode ( 'UTF-8' ) ,
256256 build_cmd_str ("svr" , (position ,)))
257257
258258
0 commit comments