Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Add test for offsets on epoch timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Formella committed Nov 21, 2013
1 parent c06148a commit 296fb80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charlatan/tests/data/special_tags.yaml
Expand Up @@ -4,4 +4,6 @@ tomorrow: !now +1d

current_epoch_time: !epoch_now

tomorrow_epoch_time: !epoch_now +1d

relationship: !rel tomorrow
8 changes: 8 additions & 0 deletions charlatan/tests/test_yaml_parser.py
Expand Up @@ -37,6 +37,14 @@ def test_epoch_now_tag(self):

self.assertEqual(current_epoch_time, self.yaml['current_epoch_time'])

def test_epoch_now_tag_with_offset(self):
"""Assert !epoch_now accepts an offset"""

tomorrow_datetime = self.current_time + datetime.timedelta(days=1)
tomorrow = datetime_to_epoch_timestamp(tomorrow_datetime)

self.assertEqual(tomorrow, self.yaml['tomorrow_epoch_time'])

def test_rel_tag(self):
"""Assert !rel tag makes the value a relationship token"""

Expand Down

0 comments on commit 296fb80

Please sign in to comment.