def set_bands(self, bands, current): model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_INT) for value in [MM_NETWORK_BAND_ANY] + get_bands(bands): human_name = BAND_MAP[value] model.append([human_name, value]) self._set_combo('band_combobox', model, current)
def test_CardSupportedBandsProperty(self): """Test for Card.SupportedBands property""" bands = self.device.Get(CRD_INTFACE, 'SupportedBands', dbus_interface=dbus.PROPERTIES_IFACE) if not bands: raise unittest.SkipTest("Cannot be tested") self.failIfIn(MM_NETWORK_BAND_ANY, get_bands(bands))
def test_NetworkSetBand(self): """Test for Network.SetBand""" _bands = self.device.Get(CRD_INTFACE, 'SupportedBands', dbus_interface=dbus.PROPERTIES_IFACE) if not _bands: raise unittest.SkipTest("Cannot be tested") bands = get_bands(_bands) while bands: band = bands.pop() self.device.SetBand(band) _band = self.device.GetBand() self.failUnless(band & _band) # leave it in BAND_ANY and give it some seconds to settle self.device.SetBand(MM_NETWORK_BAND_ANY) time.sleep(5)