Exemplo n.º 1
0
 def testLastCatalogNameIsShownByDefault(self):
     dialog = DefineCatalogDialog(self.explorer.catalogs())
     dialog.nameBox.setText("catalogname")
     dialog.urlBox.setText("localhost:8081/geoserver")
     okWidget = dialog.buttonBox.button(dialog.buttonBox.Ok)
     QTest.mouseClick(okWidget, Qt.LeftButton)
     self.assertTrue(dialog.ok)
     self.assertEquals("catalogname", dialog.name)
     self.assertEquals("http://localhost:8081/geoserver/rest", dialog.url)
     dialog = DefineCatalogDialog(self.explorer.catalogs())
     self.assertEquals("catalogname", dialog.nameBox.text())
     self.assertEquals("localhost:8081/geoserver", dialog.urlBox.text())
     okWidget = dialog.buttonBox.button(dialog.buttonBox.Ok)
     QTest.mouseClick(okWidget, Qt.LeftButton)
     settings = QSettings()
     settings.endGroup()
     settings.beginGroup("/GeoServer/Catalogs/catalogname")
     settings.remove("")
     settings.endGroup()
Exemplo n.º 2
0
 def testCreateCatalogDialogUsingExistingName(self):
     self.explorer.catalogs()["name"] = self.cat
     dialog = DefineCatalogDialog(self.explorer.catalogs())
     dialog.nameBox.setText("name")
     okWidget = dialog.buttonBox.button(dialog.buttonBox.Ok)
     QTest.mouseClick(okWidget, Qt.LeftButton)
     self.assertEquals("name_2", dialog.name)
     settings = QSettings()
     settings.beginGroup("/GeoServer/Catalogs/name")
     settings.remove("")
     settings.endGroup()
     settings.beginGroup("/GeoServer/Catalogs/name_2")
     settings.remove("")
     settings.endGroup()
     del self.explorer.catalogs()["name"]
Exemplo n.º 3
0
 def testCreateCatalogDialogWithUrlWithoutProtocol(self):
     dialog = DefineCatalogDialog(self.explorer.catalogs())
     dialog.nameBox.setText("name")
     dialog.urlBox.setText(geoserverLocation()+"/geoserver")
     dialog.passwordBox.setText("password")
     dialog.usernameBox.setText("username")
     okWidget = dialog.buttonBox.button(dialog.buttonBox.Ok)
     QTest.mouseClick(okWidget, Qt.LeftButton)
     self.assertTrue(dialog.ok)
     self.assertEquals("username", dialog.username)
     self.assertEquals("password", dialog.password)
     self.assertEquals("name", dialog.name)
     self.assertEquals("http://"+geoserverLocation()+"/geoserver/rest", dialog.url)
     settings = QSettings()
     settings.endGroup()
     settings.beginGroup("/GeoServer/Catalogs/name")
     settings.remove("")
     settings.endGroup()