Skip to content

Commit

Permalink
reorganizing utility functions into test/utils/
Browse files Browse the repository at this point in the history
* put `integration_test_helper.py` into `tests/utils/`
* `util.py` into `tests/utils/`
  * the file might need renaming
* added `__init__.py` to make `tests/` into a package
* added `__init__.py` to make `utils/` into a package
* fixed imports to work correctly
* rang the tests from terminal and they all seem to be working fine
  • Loading branch information
nh916 committed Sep 15, 2023
1 parent 6b0a4d5 commit f42f31f
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 53 deletions.
Empty file added tests/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest
import requests
from conftest import HAS_INTEGRATION_TESTS_ENABLED
from tests.conftest import HAS_INTEGRATION_TESTS_ENABLED

import cript
from cript.api.exceptions import InvalidVocabulary
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import os

import pytest
from fixtures.primary_nodes import *
from fixtures.subobjects import *
from fixtures.supporting_nodes import *
from tests.fixtures.primary_nodes import *
from tests.fixtures.subobjects import *
from tests.fixtures.supporting_nodes import *

import cript

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/primary_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import uuid

import pytest
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/subobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import uuid

import pytest
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_computational_process.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_inventory.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_material.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_project.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/primary_nodes/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import warnings

import pytest
from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript
from cript.api.exceptions import APIError
Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_algorithm.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_citation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_computational_forcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_condition.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict


def test_json(complex_condition_node, complex_condition_dict):
Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict


def test_json(complex_equipment_node, complex_equipment_dict):
Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_ingredient.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_parameter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_quantity.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import uuid

import pytest
from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript
from cript.api.exceptions import APIError
Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_software_configuration.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import json
import uuid

from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/supporting_nodes/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import uuid

import pytest
from integration_test_helper import (
from tests.utils.integration_test_helper import (
delete_integration_node_helper,
save_integration_node_helper,
)
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/supporting_nodes/test_user.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

import pytest
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript

Expand Down
2 changes: 1 addition & 1 deletion tests/test_node_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import replace

import pytest
from util import strip_uid_from_dict
from tests.utils.util import strip_uid_from_dict

import cript
from cript.nodes.core import get_new_uid
Expand Down
Empty file added tests/utils/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

import pytest
from conftest import HAS_INTEGRATION_TESTS_ENABLED
from tests.conftest import HAS_INTEGRATION_TESTS_ENABLED
from deepdiff import DeepDiff

import cript
Expand Down
File renamed without changes.

0 comments on commit f42f31f

Please sign in to comment.