Skip to content

Commit

Permalink
Tests import data without Majic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Dec 14, 2023
1 parent 57f9bb1 commit 542ec79
Showing 2 changed files with 20 additions and 18 deletions.
3 changes: 2 additions & 1 deletion cadastre/dialogs/import_dialog.py
Original file line number Diff line number Diff line change
@@ -292,7 +292,7 @@ def checkImportInputData(self):
self.qc.updateLog(msg.replace('\n', '<br/>'))
return msg

def processImport(self):
def processImport(self) -> bool:
"""
Lancement du processus d'import
"""
@@ -327,6 +327,7 @@ def processImport(self):
qi.importEdigeo()

qi.endImport()
return qi.go

def storeSettings(self):
"""
35 changes: 18 additions & 17 deletions cadastre/tests/test_import_data.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class TestCase(namedtuple('TestCase', [
pass


Cornillon = TestCase(
CornillonMajic = TestCase(
insee='13029',
commune='CORNILLON-CONFOUX',
epsg='EPSG:2154',
@@ -32,20 +32,20 @@ class TestCase(namedtuple('TestCase', [
geo_commune='132029',
)

# RemireMontjoly = TestCase(
# insee='97309',
# commune='REMIRE MONTJOLY',
# epsg='EPSG:32620',
# has_majic=False,
# lot='1',
# dept='97',
# ccocom=None,
# ccodir=None,
# direction='3',
# version='2021',
# year='2021',
# geo_commune='973309',
# )
CornillonSansMajic = TestCase(
insee='13029',
commune='CORNILLON-CONFOUX',
epsg='EPSG:2154',
has_majic=False,
lot='1',
dept='13',
ccocom='029',
ccodir='2',
direction='2',
version='2019',
year='2019',
geo_commune='132029',
)

TEST_SCHEMA = 'cadastre'

@@ -67,7 +67,7 @@ def _remove_schema(self):

def test_import(self):
"""Test to import data into a PostgreSQL database. """
for test_case in (Cornillon, ):
for test_case in (CornillonMajic, CornillonSansMajic):
with self.subTest(i=test_case.commune):
self._test_import(test_case)

@@ -126,7 +126,8 @@ def _test_import(self, test_case):
dialog.inDataYear.setValue(int(test_case.year))

# Import
dialog.btProcessImport.click()
# As we want to the return of the self.go, we call the slot directly
self.assertTrue(dialog.processImport())

# Check we have a town in edigeo
results = connection.executeSql('SELECT "geo_commune", "tex2" FROM cadastre.geo_commune;')

0 comments on commit 542ec79

Please sign in to comment.