Skip to content

Commit

Permalink
proper tests with dataStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jan 18, 2024
1 parent 8b91047 commit 88755a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 97 deletions.
27 changes: 1 addition & 26 deletions tests/unit/geometry_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,15 @@
from typing import Union
import pytest

import os
import sys
import speckle

r"""
sys.path.append(
os.path.abspath(
os.path.dirname(speckle.__file__).replace(
"speckle-qgis\\speckle", "speckle-qgis\\specklepy_qt_ui"
)
)
)
"""

# from specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from specklepy_qt_ui.qt_ui.DataStorage import DataStorage

from specklepy.objects.encoding import CurveTypeEncoding
from specklepy.objects.geometry import Arc, Line, Mesh, Point, Plane, Polycurve, Vector


@pytest.fixture()
def data_storage():
class DataStorage:
crs_offset_x: Union[int, float]
crs_offset_y: Union[int, float]
crs_rotation: Union[int, float]

def __init__(self):
pass

sample_obj = DataStorage()
sample_obj.crs_offset_x = 0
sample_obj.crs_offset_y = 0
sample_obj.crs_rotation = 0
return sample_obj


Expand Down
71 changes: 0 additions & 71 deletions tests/unit/geometry_tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,6 @@
import numpy as np
from typing import List, Tuple
import pytest
import os
import sys


def tests_path():
import specklepy_qt_ui

assert True


def test_path1():
import speckle

p = os.path.abspath(os.path.dirname(speckle.__file__))
if "speckle-qgis" not in p: # for CI
path_add = p.replace("speckle", "specklepy_qt_ui")
else: # for local debugging
path_add = p.replace(
"speckle-qgis\\speckle",
"speckle-qgis\\specklepy_qt_ui".replace(
"speckle-qgis/speckle", "speckle-qgis/specklepy_qt_ui"
),
)
assert "1" in path_add


def test_path2():
import speckle

p = os.path.abspath(os.path.dirname(speckle.__file__))
if "speckle-qgis" not in p: # for CI
path_add = p.replace("speckle", "specklepy_qt_ui")
else: # for local debugging
path_add = p.replace(
"speckle-qgis\\speckle",
"speckle-qgis\\specklepy_qt_ui".replace(
"speckle-qgis/speckle", "speckle-qgis/specklepy_qt_ui"
),
)
sys.path.append(path_add)

assert "1" in sys.path


def test_path3():
import speckle

root = os.path.abspath(
os.path.dirname(os.path.abspath(os.path.dirname(speckle.__file__)))
)
subfolders = [f.path for f in os.scandir(root) if f.is_dir()][6:]
assert "1" in subfolders


def test_path4():
import speckle

p = os.path.abspath(os.path.dirname(speckle.__file__))
if "speckle-qgis" not in p: # for CI
path_add = p.replace("speckle", "specklepy_qt_ui")
else: # for local debugging
path_add = p.replace(
"speckle-qgis\\speckle",
"speckle-qgis\\specklepy_qt_ui".replace(
"speckle-qgis/speckle", "speckle-qgis/specklepy_qt_ui"
),
)
sys.path.append(path_add)
import specklepy_qt_ui

assert "1" in os.path.dirname(specklepy_qt_ui.__file__)


from speckle.converter.geometry.utils import (
Expand Down

0 comments on commit 88755a7

Please sign in to comment.