Skip to content

Commit

Permalink
Merge pull request cylc#5898 from MetRonnie/integration-reftest
Browse files Browse the repository at this point in the history
Replace more functional reftests with integration reftests
  • Loading branch information
hjoliver authored Jan 8, 2024
2 parents 1c1e840 + d4a9d0a commit df350cd
Show file tree
Hide file tree
Showing 40 changed files with 310 additions and 474 deletions.
24 changes: 14 additions & 10 deletions cylc/flow/cycling/iso8601.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def from_nonstandard_string(cls, point_string):

def add(self, other):
"""Add an Interval to self."""
return ISO8601Point(self._iso_point_add(self.value, other.value))
return ISO8601Point(self._iso_point_add(
self.value, other.value, CALENDAR.mode
))

def standardise(self):
"""Reformat self.value into a standard representation."""
Expand All @@ -106,41 +108,43 @@ def standardise(self):
def sub(self, other):
"""Subtract a Point or Interval from self."""
if isinstance(other, ISO8601Point):
return ISO8601Interval(
self._iso_point_sub_point(self.value, other.value))
return ISO8601Point(
self._iso_point_sub_interval(self.value, other.value))
return ISO8601Interval(self._iso_point_sub_point(
self.value, other.value, CALENDAR.mode
))
return ISO8601Point(self._iso_point_sub_interval(
self.value, other.value, CALENDAR.mode
))

@staticmethod
@lru_cache(10000)
def _iso_point_add(point_string, interval_string):
def _iso_point_add(point_string, interval_string, _calendar_mode):
"""Add the parsed point_string to the parsed interval_string."""
point = point_parse(point_string)
interval = interval_parse(interval_string)
return str(point + interval)

def _cmp(self, other: 'ISO8601Point') -> int:
return self._iso_point_cmp(self.value, other.value)
return self._iso_point_cmp(self.value, other.value, CALENDAR.mode)

@staticmethod
@lru_cache(10000)
def _iso_point_cmp(point_string, other_point_string):
def _iso_point_cmp(point_string, other_point_string, _calendar_mode):
"""Compare the parsed point_string to the other one."""
point = point_parse(point_string)
other_point = point_parse(other_point_string)
return cmp(point, other_point)

@staticmethod
@lru_cache(10000)
def _iso_point_sub_interval(point_string, interval_string):
def _iso_point_sub_interval(point_string, interval_string, _calendar_mode):
"""Return the parsed point_string minus the parsed interval_string."""
point = point_parse(point_string)
interval = interval_parse(interval_string)
return str(point - interval)

@staticmethod
@lru_cache(10000)
def _iso_point_sub_point(point_string, other_point_string):
def _iso_point_sub_point(point_string, other_point_string, _calendar_mode):
"""Return the difference between the two parsed point strings."""
point = point_parse(point_string)
other_point = point_parse(other_point_string)
Expand Down
22 changes: 0 additions & 22 deletions tests/functional/cyclers/21-360_calendar.t

This file was deleted.

11 changes: 0 additions & 11 deletions tests/functional/cyclers/21-360_calendar/flow.cylc

This file was deleted.

9 changes: 0 additions & 9 deletions tests/functional/cyclers/21-360_calendar/graph.plain.ref

This file was deleted.

6 changes: 0 additions & 6 deletions tests/functional/cyclers/21-360_calendar/reference.log

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/cyclers/36-icp_fcp_notation.t

This file was deleted.

15 changes: 0 additions & 15 deletions tests/functional/cyclers/36-icp_fcp_notation/flow.cylc

This file was deleted.

7 changes: 0 additions & 7 deletions tests/functional/cyclers/36-icp_fcp_notation/reference.log

This file was deleted.

36 changes: 0 additions & 36 deletions tests/functional/cyclers/47-icp_fcp_notation.t

This file was deleted.

15 changes: 0 additions & 15 deletions tests/functional/cyclers/47-icp_fcp_notation/flow.cylc

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/cyclers/49-365_calendar.t

This file was deleted.

11 changes: 0 additions & 11 deletions tests/functional/cyclers/49-365_calendar/flow.cylc

This file was deleted.

5 changes: 0 additions & 5 deletions tests/functional/cyclers/49-365_calendar/graph.plain.ref

This file was deleted.

4 changes: 0 additions & 4 deletions tests/functional/cyclers/49-365_calendar/reference.log

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/cyclers/50-366_calendar.t

This file was deleted.

11 changes: 0 additions & 11 deletions tests/functional/cyclers/50-366_calendar/flow.cylc

This file was deleted.

7 changes: 0 additions & 7 deletions tests/functional/cyclers/50-366_calendar/graph.plain.ref

This file was deleted.

5 changes: 0 additions & 5 deletions tests/functional/cyclers/50-366_calendar/reference.log

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/cyclers/51-recurrence_fmt_1.t

This file was deleted.

11 changes: 0 additions & 11 deletions tests/functional/cyclers/51-recurrence_fmt_1/flow.cylc

This file was deleted.

6 changes: 0 additions & 6 deletions tests/functional/cyclers/51-recurrence_fmt_1/reference.log

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/pre-initial/01-basic.t

This file was deleted.

10 changes: 0 additions & 10 deletions tests/functional/pre-initial/01-basic/flow.cylc

This file was deleted.

6 changes: 0 additions & 6 deletions tests/functional/pre-initial/01-basic/reference.log

This file was deleted.

Loading

0 comments on commit df350cd

Please sign in to comment.