def test_network_cfg_write_values_no_port(self): self.nc = networkConfig.NetworkConfigDialog() self.stubConfig = stubs.StubConfig() self.nc.cfg = self.stubConfig self.nc.enableProxyButton.set_active(True) self.nc.proxyEntry.set_text("example.com") self.nc.write_values()
def test_network_cfg_save_change_values(self): self.nc = networkConfig.NetworkConfigDialog() self.stubConfig = stubs.StubConfig() self.nc.cfg = self.stubConfig self.nc.enableProxyButton.set_active(True) self.nc.proxyEntry.set_text("example.com:10000") self.expected = {} self.nc.on_save_clicked(self.nc.saveButton) self.assertNotEqual(self.expected, self.nc.cfg.store)
def test_network_cfg_write_values_with_auth(self): self.nc = networkConfig.NetworkConfigDialog() self.stubConfig = stubs.StubConfig() self.nc.cfg = self.stubConfig self.nc.enableProxyButton.set_active(True) self.nc.proxyEntry.set_text("example.com:10000") self.nc.enableProxyAuthButton.set_active(True) self.nc.proxyUserEntry.set_text("redhatUser") self.nc.proxyPasswordEntry.set_text("redhatPass") self.nc.write_values() actual_user = self.nc.cfg.store['server']['proxy_user'] actual_password = self.nc.cfg.store['server']['proxy_password'] self.assertTrue(actual_user == "redhatUser") self.assertTrue(actual_password == "redhatPass")
def test_network_cfg_set_initial_values(self): self.stubConfig = stubs.StubConfig() self.nc.set_initial_values()
def setUp(self): SubManFixture.setUp(self) self.nc = networkConfig.NetworkConfigDialog() self.stubConfig = stubs.StubConfig()
def test_network_cfg_write_fail(self): self.nc = networkConfig.NetworkConfigDialog() self.stubConfig = stubs.StubConfig() self.stubConfig.raise_io = True self.nc.cfg = self.stubConfig self.nc.write_values()