コード例 #1
0
 def test_hardware_requirements_label_utf8(self, mock_get_hw):
     magic_marker = u" \u1234 GPS"
     mock_get_hw.return_value = utf8(magic_marker)
     label = HardwareRequirementsLabel()
     label.set_hardware_requirement('hardware::gps', 'yes')
     self.assertEqual(
         label.get_label(), u"%s%s" %
         (HardwareRequirementsLabel.SUPPORTED_SYM["yes"], magic_marker))
コード例 #2
0
 def test_hardware_requirements_label(self):
     label = HardwareRequirementsLabel()
     label.set_hardware_requirement('hardware::gps', 'yes')
     self.assertEqual(
         label.get_label(),
         u"%sGPS" % HardwareRequirementsLabel.SUPPORTED_SYM["yes"])
     # test the gtk bits
     self.assertEqual(type(label.get_children()[0]), Gtk.Label)
     # test setting it again
     label.set_hardware_requirement('hardware::video:opengl', 'yes')
     self.assertEqual(len(label.get_children()), 1)