diff --git a/tests/upgradeability-util/TestUpgrades-0.5.0.sol b/tests/unit/utils/test_data/upgradeability_util/TestUpgrades-0.5.0.sol similarity index 100% rename from tests/upgradeability-util/TestUpgrades-0.5.0.sol rename to tests/unit/utils/test_data/upgradeability_util/TestUpgrades-0.5.0.sol diff --git a/tests/upgradeability-util/TestUpgrades-0.8.2.sol b/tests/unit/utils/test_data/upgradeability_util/TestUpgrades-0.8.2.sol similarity index 100% rename from tests/upgradeability-util/TestUpgrades-0.8.2.sol rename to tests/unit/utils/test_data/upgradeability_util/TestUpgrades-0.8.2.sol diff --git a/tests/upgradeability-util/src/Address.sol b/tests/unit/utils/test_data/upgradeability_util/src/Address.sol similarity index 100% rename from tests/upgradeability-util/src/Address.sol rename to tests/unit/utils/test_data/upgradeability_util/src/Address.sol diff --git a/tests/upgradeability-util/src/ContractV1.sol b/tests/unit/utils/test_data/upgradeability_util/src/ContractV1.sol similarity index 100% rename from tests/upgradeability-util/src/ContractV1.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ContractV1.sol diff --git a/tests/upgradeability-util/src/ContractV2.sol b/tests/unit/utils/test_data/upgradeability_util/src/ContractV2.sol similarity index 100% rename from tests/upgradeability-util/src/ContractV2.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ContractV2.sol diff --git a/tests/upgradeability-util/src/EIP1822Proxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/EIP1822Proxy.sol similarity index 100% rename from tests/upgradeability-util/src/EIP1822Proxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/EIP1822Proxy.sol diff --git a/tests/upgradeability-util/src/ERC1967Proxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/ERC1967Proxy.sol similarity index 100% rename from tests/upgradeability-util/src/ERC1967Proxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ERC1967Proxy.sol diff --git a/tests/upgradeability-util/src/ERC1967Upgrade.sol b/tests/unit/utils/test_data/upgradeability_util/src/ERC1967Upgrade.sol similarity index 100% rename from tests/upgradeability-util/src/ERC1967Upgrade.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ERC1967Upgrade.sol diff --git a/tests/upgradeability-util/src/InheritedStorageProxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/InheritedStorageProxy.sol similarity index 100% rename from tests/upgradeability-util/src/InheritedStorageProxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/InheritedStorageProxy.sol diff --git a/tests/upgradeability-util/src/MasterCopyProxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/MasterCopyProxy.sol similarity index 100% rename from tests/upgradeability-util/src/MasterCopyProxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/MasterCopyProxy.sol diff --git a/tests/upgradeability-util/src/Proxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/Proxy.sol similarity index 100% rename from tests/upgradeability-util/src/Proxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/Proxy.sol diff --git a/tests/upgradeability-util/src/ProxyStorage.sol b/tests/unit/utils/test_data/upgradeability_util/src/ProxyStorage.sol similarity index 100% rename from tests/upgradeability-util/src/ProxyStorage.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ProxyStorage.sol diff --git a/tests/upgradeability-util/src/StorageSlot.sol b/tests/unit/utils/test_data/upgradeability_util/src/StorageSlot.sol similarity index 100% rename from tests/upgradeability-util/src/StorageSlot.sol rename to tests/unit/utils/test_data/upgradeability_util/src/StorageSlot.sol diff --git a/tests/upgradeability-util/src/SynthProxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/SynthProxy.sol similarity index 100% rename from tests/upgradeability-util/src/SynthProxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/SynthProxy.sol diff --git a/tests/upgradeability-util/src/ZosProxy.sol b/tests/unit/utils/test_data/upgradeability_util/src/ZosProxy.sol similarity index 100% rename from tests/upgradeability-util/src/ZosProxy.sol rename to tests/unit/utils/test_data/upgradeability_util/src/ZosProxy.sol diff --git a/tests/test_upgradeability_util.py b/tests/unit/utils/test_upgradeability_util.py similarity index 92% rename from tests/test_upgradeability_util.py rename to tests/unit/utils/test_upgradeability_util.py index dd12d68a1..520edaef9 100644 --- a/tests/test_upgradeability_util.py +++ b/tests/unit/utils/test_upgradeability_util.py @@ -11,14 +11,14 @@ from slither.utils.upgradeability import ( ) SLITHER_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -UPGRADE_TEST_ROOT = os.path.join(SLITHER_ROOT, "tests", "upgradeability-util") +TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data" / "upgradeability_util" # pylint: disable=too-many-locals def test_upgrades_compare() -> None: solc_select.switch_global_version("0.8.2", always_install=True) - sl = Slither(os.path.join(UPGRADE_TEST_ROOT, "TestUpgrades-0.8.2.sol")) + sl = Slither(os.path.join(TEST_DATA_DIR, "TestUpgrades-0.8.2.sol")) v1 = sl.get_contract_from_name("ContractV1")[0] v2 = sl.get_contract_from_name("ContractV2")[0] missing_vars, new_vars, tainted_vars, new_funcs, modified_funcs, tainted_funcs = compare(v1, v2) @@ -38,7 +38,7 @@ def test_upgrades_compare() -> None: def test_upgrades_implementation_var() -> None: solc_select.switch_global_version("0.8.2", always_install=True) - sl = Slither(os.path.join(UPGRADE_TEST_ROOT, "TestUpgrades-0.8.2.sol")) + sl = Slither(os.path.join(TEST_DATA_DIR, "TestUpgrades-0.8.2.sol")) erc_1967_proxy = sl.get_contract_from_name("ERC1967Proxy")[0] storage_proxy = sl.get_contract_from_name("InheritedStorageProxy")[0] @@ -53,7 +53,7 @@ def test_upgrades_implementation_var() -> None: assert slot.slot == 1 solc_select.switch_global_version("0.5.0", always_install=True) - sl = Slither(os.path.join(UPGRADE_TEST_ROOT, "TestUpgrades-0.5.0.sol")) + sl = Slither(os.path.join(TEST_DATA_DIR, "TestUpgrades-0.5.0.sol")) eip_1822_proxy = sl.get_contract_from_name("EIP1822Proxy")[0] # zos_proxy = sl.get_contract_from_name("ZosProxy")[0]