~diegosarmentero/ubuntuone-windows-installer/not-validated-account

« back to all changes in this revision

Viewing changes to ubuntuone_installer/gui/qt/tests/__init__.py

- Fixed: Process finished successfully (LP: #859743).

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
            self.ui.backend._called.clear()
209
209
 
210
210
        self.patch(loadingoverlay, 'LoadingOverlay', FakeOverlay)
 
211
 
 
212
    def get_pixmap_data(self, pixmap):
 
213
        """Get the raw data of a QPixmap."""
 
214
        byte_array = QtCore.QByteArray()
 
215
        array_buffer = QtCore.QBuffer(byte_array)
 
216
        pixmap.save(array_buffer, "PNG")
 
217
        return byte_array
 
218
 
 
219
    # Invalid name "assertEqualPixmap"
 
220
    # pylint: disable=C0103
 
221
 
 
222
    def assertEqualPixmaps(self, pixmap1, pixmap2):
 
223
        """Compare two Qt pixmaps."""
 
224
        d1 = self.get_pixmap_data(pixmap1)
 
225
        d2 = self.get_pixmap_data(pixmap2)
 
226
        self.assertEqual(d1, d2)