Skip to content

Commit

Permalink
tests: fix relative imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ElJocho authored and matthiasschaub committed Jan 10, 2024
1 parent a1ff002 commit 57e9e69
Showing 12 changed files with 20 additions and 39 deletions.
3 changes: 1 addition & 2 deletions mapswipe_workers/tests/integration/test_archive_project.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import time
import unittest

from tests.integration import set_up, tear_down
from mapswipe_workers import auth
from mapswipe_workers.config import FIREBASE_DB
from mapswipe_workers.firebase_to_postgres import archive_project

from . import set_up, tear_down


class TestArchiveProject(unittest.TestCase):
def setUp(self):
Original file line number Diff line number Diff line change
@@ -2,11 +2,10 @@

from click.testing import CliRunner

from tests.integration import set_up, tear_down
from mapswipe_workers import auth, mapswipe_workers
from mapswipe_workers.utils.create_directories import create_directories

from . import set_up, tear_down


class TestCreateProject(unittest.TestCase):
def setUp(self):
Original file line number Diff line number Diff line change
@@ -2,11 +2,10 @@

from click.testing import CliRunner

from tests.integration import set_up, tear_down
from mapswipe_workers import auth, mapswipe_workers
from mapswipe_workers.utils.create_directories import create_directories

from . import set_up, tear_down


def setUpProjectDraft(project_type_name, file_name):
project_id = set_up.create_test_project_draft(project_type_name, file_name)
6 changes: 2 additions & 4 deletions mapswipe_workers/tests/integration/test_delete_project.py
Original file line number Diff line number Diff line change
@@ -5,12 +5,10 @@
from mapswipe_workers.config import FIREBASE_DB
from mapswipe_workers.definitions import CustomError
from mapswipe_workers.firebase_to_postgres import delete_project
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestDeleteProject(BaseTestCase):
class TestDeleteProject(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "tile_map_service_grid"
6 changes: 2 additions & 4 deletions mapswipe_workers/tests/integration/test_get_results.py
Original file line number Diff line number Diff line change
@@ -3,12 +3,10 @@
import unittest

from mapswipe_workers.generate_stats.project_stats import get_results
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestGetResults(BaseTestCase):
class TestGetResults(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "tile_map_service_grid"
Original file line number Diff line number Diff line change
@@ -3,12 +3,10 @@
import unittest

from mapswipe_workers.generate_stats.project_stats import get_results
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestGetResults(BaseTestCase):
class TestGetResults(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "tile_map_service_grid"
Original file line number Diff line number Diff line change
@@ -4,12 +4,10 @@

from mapswipe_workers import auth
from mapswipe_workers.firebase_to_postgres import transfer_results
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestTransferInvalidResultsProject(BaseTestCase):
class TestTransferInvalidResultsProject(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "tile_map_service_grid"
Original file line number Diff line number Diff line change
@@ -2,12 +2,10 @@

from mapswipe_workers import auth
from mapswipe_workers.firebase_to_postgres import transfer_results
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestTransferManyResults(BaseTestCase):
class TestTransferManyResults(base.BaseTestCase):
def setUp(self):
project_type = "tile_map_service_grid"
fixture_name = "build_area_heidelberg"
6 changes: 2 additions & 4 deletions mapswipe_workers/tests/integration/test_update_data.py
Original file line number Diff line number Diff line change
@@ -6,12 +6,10 @@
get_contributor_count_from_postgres,
get_project_progress,
)
from tests.integration import base, set_up, tear_down

from . import set_up, tear_down
from .base import BaseTestCase


class TestUpdateData(BaseTestCase):
class TestUpdateData(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "tile_map_service_grid"
3 changes: 1 addition & 2 deletions mapswipe_workers/tests/integration/test_update_user_data.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import unittest
import uuid

from tests.integration import set_up, tear_down
from mapswipe_workers import auth
from mapswipe_workers.firebase_to_postgres import update_data

from . import set_up, tear_down


class TestUpdateUserData(unittest.TestCase):
def setUp(self):
Original file line number Diff line number Diff line change
@@ -4,11 +4,10 @@
from unittest import mock

from mapswipe_workers.firebase_to_postgres import update_data
from tests.integration import base

from .base import BaseTestCase


class TestUpdateProjectData(BaseTestCase):
class TestUpdateProjectData(base.BaseTestCase):
class FbDbMock:
url: Union[str, None]

6 changes: 2 additions & 4 deletions mapswipe_workers/tests/integration/test_user_stats.py
Original file line number Diff line number Diff line change
@@ -10,12 +10,10 @@
get_tasks,
)
from mapswipe_workers.generate_stats.user_stats import get_agg_results_by_user_id
from tests.integration import set_up, tear_down
from tests.integration import base, set_up, tear_down

from .base import BaseTestCase


class TestUserStats(BaseTestCase):
class TestUserStats(base.BaseTestCase):
def setUp(self):
super().setUp()
project_type = "footprint"

0 comments on commit 57e9e69

Please sign in to comment.