Skip to content

Commit

Permalink
Merge pull request #37 from comtihon/dashes_as_math_fix
Browse files Browse the repository at this point in the history
add date equals test
  • Loading branch information
comtihon authored Mar 20, 2020
2 parents 032a359 + 7ef61ea commit 2d62b96
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dist: bionic
language: python
sudo: true
python:
- '3.5'
- '3.6'
Expand Down
12 changes: 11 additions & 1 deletion test/steps/checks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,14 @@ def test_items_iteration(self):
equals: {the: '{{ ITEM.k }}', is: 'a'}
''')
runner = Runner(self.test_dir, join(self.test_dir, 'main.yaml'), None)
self.assertTrue(runner.run_tests())
self.assertTrue(runner.run_tests())

# test if dates with dashes are not calculated as math (old dates, i.e. 1973-03-10 are still calculated as math)
def test_compate_dates(self):
self.populate_file('main.yaml', '''---
steps:
- check:
equals: {the: '2020-03-11', is_not: '2020-11-03' }
''')
runner = Runner(self.test_dir, join(self.test_dir, 'main.yaml'), None)
self.assertTrue(runner.run_tests())
6 changes: 0 additions & 6 deletions test/steps/test/tmp/checks_test/main.yaml

This file was deleted.

1 change: 1 addition & 0 deletions test/utils/misc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_template_with_simple_object(self):
self.assertEqual(17, fill_template('{{ OUTPUT }}', {'OUTPUT': 17}))
self.assertEqual(4.2, fill_template('{{ OUTPUT }}', {'OUTPUT': 4.2}))
self.assertEqual('string', fill_template('{{ OUTPUT }}', {'OUTPUT': 'string'}))
self.assertEqual('2020-03-11', fill_template('{{ OUTPUT }}', {'OUTPUT': '2020-03-11'}))

# templates are being filled in correctly with complex objects
def test_template_with_complex_object(self):
Expand Down

0 comments on commit 2d62b96

Please sign in to comment.