2024-01-29 08:46:45 +01:00
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
sys.path.insert(1, os.path.join(sys.path[0], "../../"))
|
|
|
|
|
import rips
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_well_path(rips_instance, initialize_test):
|
|
|
|
|
well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0]
|
2024-09-13 12:55:26 +02:00
|
|
|
assert len(well_path_coll.well_paths()) == 0
|
2024-01-29 08:46:45 +01:00
|
|
|
|
|
|
|
|
well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
|
|
|
|
|
well_path2 = well_path_coll.add_new_object(rips.ModeledWellPath)
|
2024-09-13 12:55:26 +02:00
|
|
|
assert len(well_path_coll.well_paths()) == 2
|
2024-01-29 08:46:45 +01:00
|
|
|
|
|
|
|
|
well_path.delete()
|
2024-09-13 12:55:26 +02:00
|
|
|
assert len(well_path_coll.well_paths()) == 1
|
2024-01-29 08:46:45 +01:00
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
# Delete again should throw exception
|
|
|
|
|
well_path.delete()
|
|
|
|
|
assert False
|
|
|
|
|
except Exception:
|
|
|
|
|
assert True
|
|
|
|
|
|
|
|
|
|
well_path2.delete()
|
2024-09-13 12:55:26 +02:00
|
|
|
assert len(well_path_coll.well_paths()) == 0
|