Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add date equals test #37

Merged
merged 3 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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