|
18 | 18 | ) |
19 | 19 |
|
20 | 20 | from tests.data.datasets import example_dataset_type_url |
21 | | -from tests.data.pagination import paginations |
22 | | -from tests.data.time_interval import i64_datetimes |
23 | 21 | from tests.data.well_known_types import ( |
24 | 22 | datetime_messages, |
25 | 23 | duration_messages, |
|
31 | 29 | vec3_messages, |
32 | 30 | ) |
33 | 31 | from tests.example_dataset.example_dataset_pb2 import ExampleDatapoint |
34 | | -from tilebox.datasets.data.datapoint import ( |
35 | | - AnyMessage, |
36 | | - DatapointInterval, |
37 | | - DatapointIntervalLike, |
38 | | - IngestResponse, |
39 | | - QueryResultPage, |
40 | | - RepeatedAny, |
41 | | -) |
42 | | -from tilebox.datasets.data.time_interval import ( |
43 | | - datetime_to_timestamp, |
44 | | -) |
| 32 | +from tests.query.pagination import paginations |
| 33 | +from tests.query.time_interval import i64_datetimes |
| 34 | +from tilebox.datasets.data.datapoint import AnyMessage, IngestResponse, QueryResultPage, RepeatedAny |
45 | 35 | from tilebox.datasets.datasets.v1 import core_pb2 |
46 | | - |
47 | | - |
48 | | -@composite |
49 | | -def datapoint_intervals(draw: DrawFn) -> DatapointInterval: |
50 | | - """A hypothesis strategy for generating random datapoint intervals""" |
51 | | - start = draw(uuids(version=4)) |
52 | | - end = draw(uuids(version=4)) |
53 | | - start, end = min(start, end), max(start, end) # make sure start is before end |
54 | | - |
55 | | - start_exclusive = draw(booleans()) |
56 | | - end_inclusive = draw(booleans()) |
57 | | - |
58 | | - return DatapointInterval(start, end, start_exclusive, end_inclusive) |
59 | | - |
60 | | - |
61 | | -@composite |
62 | | -def datapoint_intervals_like(draw: DrawFn) -> DatapointIntervalLike: |
63 | | - """A hypothesis strategy for generating random datapoint intervals""" |
64 | | - interval = draw(datapoint_intervals()) |
65 | | - return draw( |
66 | | - one_of( |
67 | | - just(interval), |
68 | | - just((str(interval.start_id), str(interval.end_id))), |
69 | | - just((interval.start_id, interval.end_id)), |
70 | | - ) |
71 | | - ) |
| 36 | +from tilebox.datasets.query.time_interval import datetime_to_timestamp |
72 | 37 |
|
73 | 38 |
|
74 | 39 | @composite |
|
0 commit comments