From f4cc3b79980c4d9b5a4485f38e354b62811dd52c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 10 Jun 2022 01:14:59 +0300 Subject: tests: Replace double quotes with single quotes The code base mixes single and double quotes. Standardize on single quotes except for triple-quoted strings (to match the PEP8 coding style) and where the string contains single quotes to avoid the need to escape them. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- tests/kms-test-brxalloc.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/kms-test-brxalloc.py') diff --git a/tests/kms-test-brxalloc.py b/tests/kms-test-brxalloc.py index dbdc789..af6dd49 100755 --- a/tests/kms-test-brxalloc.py +++ b/tests/kms-test-brxalloc.py @@ -21,9 +21,9 @@ class BRxAllocTest(kmstest.KMSTest): # instance to test dynamic assignment of the BRU and BRS to pipelines. # This is only occurs on H3 ES2.0 and M3-N. Check the SoC model through # sysfs as we can't detected it through the DRM/KMS API. - soc = open("/sys/devices/soc0/soc_id", "rb").read().strip().decode() - if soc not in ["r8a7795", "r8a77965"]: - self.skip("VSPDL (BRU+BRS) not available") + soc = open('/sys/devices/soc0/soc_id', 'rb').read().strip().decode() + if soc not in ['r8a7795', 'r8a77965']: + self.skip('VSPDL (BRU+BRS) not available') return outputs = [Output(), Output()] @@ -38,11 +38,11 @@ class BRxAllocTest(kmstest.KMSTest): # Verify that the two CRTCs share the same planes planes = outputs[0].crtc.possible_planes if planes != outputs[1].crtc.possible_planes: - self.skip("Planes differ for CRTCs %u and %u" % \ + self.skip('Planes differ for CRTCs %u and %u' % \ (outputs[0].crtc.id, outputs[1].crtc.id)) return - self.logger.log("Found %u planes for CRTCs %u and %u" % \ + self.logger.log('Found %u planes for CRTCs %u and %u' % \ (len(planes), outputs[0].crtc.id, outputs[1].crtc.id)) # Get one connector for each CRTC @@ -58,11 +58,11 @@ class BRxAllocTest(kmstest.KMSTest): outputs[1].connector = connector if not outputs[0].connector or not outputs[1].connector: - self.skip("No connected connectors for CRTCs %u and %u " % \ + self.skip('No connected connectors for CRTCs %u and %u ' % \ (outputs[0].crtc.id, outputs[1].crtc.id)) return - self.start("Moving %u planes from %s to %s" % \ + self.start('Moving %u planes from %s to %s' % \ (len(planes), outputs[0].connector.fullname, outputs[1].connector.fullname)) # Set the initial mode for both outputs and wait 5s for the monitors to @@ -70,17 +70,17 @@ class BRxAllocTest(kmstest.KMSTest): for output in outputs: # Get the default mode and create a framebuffer mode = output.connector.get_default_mode() - output.fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, "XR24") + output.fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, 'XR24') pykms.draw_test_pattern(output.fb) # Set the mode with no plane ret = self.atomic_crtc_mode_set(output.crtc, output.connector, mode, sync=True) if ret < 0: - self.fail("atomic mode set on %s failed with %d" % \ + self.fail('atomic mode set on %s failed with %d' % \ (output.connector.fullname, ret)) return - self.logger.log("Initial atomic mode set completed") + self.logger.log('Initial atomic mode set completed') time.sleep(5) # Add all planes @@ -88,13 +88,13 @@ class BRxAllocTest(kmstest.KMSTest): output = outputs[0] for plane in planes: - self.logger.log("Adding plane %u to %s" % (plane.id, output.connector.fullname)) + self.logger.log('Adding plane %u to %s' % (plane.id, output.connector.fullname)) source = kmstest.Rect(0, 0, output.fb.width, output.fb.height) destination = kmstest.Rect(offset, offset, output.fb.width, output.fb.height) ret = self.atomic_plane_set(plane, output.crtc, source, destination, output.fb, sync=True) if ret < 0: - self.fail("atomic plane set failed with %d" % ret) + self.fail('atomic plane set failed with %d' % ret) return offset += 50 @@ -106,20 +106,20 @@ class BRxAllocTest(kmstest.KMSTest): output = outputs[1] for plane in planes: - self.logger.log("Moving plane %u to %s" % (plane.id, output.connector.fullname)) + self.logger.log('Moving plane %u to %s' % (plane.id, output.connector.fullname)) # Switching CRTC directly is not supported by DRM, start by # disabling the plane. ret = self.atomic_plane_disable(plane) if ret < 0: - self.fail("atomic plane disable failed with %d" % ret) + self.fail('atomic plane disable failed with %d' % ret) return source = kmstest.Rect(0, 0, output.fb.width, output.fb.height) destination = kmstest.Rect(offset, offset, output.fb.width, output.fb.height) ret = self.atomic_plane_set(plane, output.crtc, source, destination, output.fb) if ret < 0: - self.fail("atomic plane set failed with %d" % ret) + self.fail('atomic plane set failed with %d' % ret) return self.run(1) -- cgit v1.2.3