Commit Graph

140 Commits

Author SHA1 Message Date
Pedro Algarvio
82eea9057a
Proper mocking 2017-04-01 14:22:56 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Pedro Algarvio
b25b26e23d
Cleanup test attributes once finished 2017-03-28 19:00:51 +01:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Pedro Algarvio
9b2d79317a
Handle different test outcome under Py3 2017-02-17 20:48:55 +00:00
Nicole Thomas
63c7c79455 Fix the new jinja_test failures (#39262)
Refs #37808

The max fuction returns an int, not a float, as does the min function.
This updates the assertions to compare against ints.
2017-02-09 08:53:00 -07:00
Mircea Ulinic
1b397e1b21 Lindt 2017-01-25 16:32:09 +00:00
Mircea Ulinic
9be7de2d4c regex_match filter and tests 2017-01-18 15:01:05 +00:00
Mircea Ulinic
a345e39c5a Test Jinja filters 2017-01-18 15:01:05 +00:00
rallytime
342a5ac0b8 Merge branch '2016.11' into 'develop'
No conflicts.
2017-01-06 10:31:51 -05:00
rallytime
30f14d15df Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/config/__init__.py
  - salt/engines/slack.py
2017-01-04 16:54:58 -05:00
Jonathan Ballet
2e7f743371 yaml: support unicode serialization/deserialization
Fix: #30454
2017-01-04 13:29:28 +01:00
Jonathan Ballet
df76113c5c jinja: test the "yaml" filter with ordered dicts 2017-01-04 13:29:28 +01:00
Loren Gordon
20eb0bf347 Adds a set theory jinja filter unique 2016-11-04 10:14:24 -04:00
Loren Gordon
f1beaa0ef4 Adds a jinja filter regex_escape
Fixes #37429
2016-11-04 09:54:54 -04:00
rallytime
112903ad7e Merge branch '2016.3' into 'carbon'
Conflicts:
  - conf/master
  - doc/ref/configuration/master.rst
  - salt/cli/daemons.py
  - salt/client/ssh/__init__.py
  - salt/config/__init__.py
  - salt/modules/archive.py
  - salt/modules/cmdmod.py
  - tests/unit/states/service_test.py
2016-09-29 09:56:43 -06:00
Jonathan Ballet
79fdc12395 jinja: fix YAML terminator removal in Jinja's "yaml" filter 2016-09-27 18:52:49 +02:00
rallytime
1fe0b69a6c Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/modules/blockdev.py
  - salt/modules/ddns.py
  - salt/modules/inspectlib/collector.py
  - salt/modules/linux_sysctl.py
  - salt/modules/status.py
  - salt/modules/x509.py
  - salt/utils/process.py
  - salt/utils/verify.py
  - tests/integration/__init__.py
  - tests/integration/modules/state.py
  - tests/integration/states/cmd.py
2016-08-12 16:21:58 -06:00
Erik Johnson
a375dd7e1f Clean up open filehandles (#35359)
* salt/crypt.py: clean up open filehandles

* salt/fileclient.py: clean up open filehandles

* salt/grains/core.py: clean up open filehandles

* salt/modules/cp.py: clean up open filehandles

* salt/modules/data.py: clean up open filehandles

* salt/modules/dnsutil.py: clean up open filehandles

* salt/modules/dockerng.py: clean up open filehandles

* salt/modules/inspectlib/collector.py: clean up open filehandles

* salt/modules/file.py: clean up open filehandles

* salt/modules/hosts.py: clean up open filehandles

* salt/modules/incron.py: clean up open filehandles

* salt/modules/dpkg.py: clean up open filehandles

* salt/modules/linux_sysctl.py: clean up open filehandles

* salt/modules/netbsd_sysctl.py: clean up open filehandles

* salt/modules/network.py: clean up open filehandles

* salt/modules/nftables.py: clean up open filehandles

* salt/modules/openbsd_sysctl.py: clean up open filehandles

* salt/modules/rh_ip.py: clean up open filehandles

* salt/modules/portage_config.py: clean up open filehandles

* salt/modules/status.py: clean up open filehandles

* salt/modules/tls.py: clean up open filehandles

* salt/modules/xapi.py: clean up open filehandles

* salt/modules/x509.py: clean up open filehandles

* salt/modules/virt.py: clean up open filehandles

* salt/modules/zcbuildout.py: clean up open filehandles

* salt/returners/local_cache.py: clean up open filehandles

* salt/utils/cloud.py: clean up open filehandles

* salt/states/pkgrepo.py: clean up open filehandles

* salt/states/x509.py: clean up open filehandles

* salt/transport/mixins/auth.py: clean up open filehandles

* salt/utils/__init__.py: clean up open filehandles

* salt/states/pkg.py: clean up open filehandles

* salt/utils/minion.py: clean up open filehandles

* salt/utils/openstack/nova.py: clean up open filehandles

* salt/utils/openstack/swift.py: clean up open filehandles

* salt/utils/process.py: clean up open filehandles

* salt/utils/templates.py: clean up open filehandles

* salt/utils/virt.py: clean up open filehandles

* tests/integration/__init__.py: clean up open filehandles

* tests/integration/cli/grains.py: clean up open filehandles

* tests/integration/client/standard.py: clean up open filehandles

* tests/integration/modules/hosts.py: clean up open filehandles

* tests/unit/utils/vt_test.py: clean up open filehandles

* tests/integration/shell/enabled.py: clean up open filehandles

* tests/integration/states/cmd.py: clean up open filehandles

* tests/integration/states/file.py: clean up open filehandles

* tests/integration/states/match.py: clean up open filehandles

* tests/unit/config_test.py: clean up open filehandles

* tests/unit/templates/jinja_test.py: clean up open filehandles

* tests/unit/utils/find_test.py: clean up open filehandles

* tests/integration/modules/state.py: clean up open filehandles

* Update dnsutil_test to reflect changes in fopen usage
2016-08-11 10:45:24 -06:00
rallytime
c7c9e3b64b PY3: Fixup jinja template unit tests 2016-08-03 12:45:29 -06:00
Mike Place
b3b1536afd Derp 2015-06-10 15:50:53 -06:00
Mike Place
7e153bc6a9 Fix unit test warnings 2015-06-10 15:37:01 -06:00
Michael Steed
f9cf15ad46 fix new failures on ubuntu 14.04 2015-06-09 14:18:04 -06:00
Michael Steed
8669dacaf1 likewise in test_render_with_utf8_syntax_error() 2015-06-09 11:48:13 -06:00
Michael Steed
4b34b60623 set encoding in test_render_with_unicode_syntax_error() 2015-06-09 11:43:23 -06:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Erik Johnson
59e7481e2b Fix TestSaltCacheLoader tests
Similar fixes as made for TestGetTemplate
2015-01-26 16:04:21 -06:00
Erik Johnson
d34c0c7787 Fix jinja tests
With recent edits to the jinja templating system, file_roots and
pillar_roots are referenced, so they need to be in the mocked opts dict.
2015-01-26 13:10:05 -06:00
Erik Johnson
c1fd180c45 Fix jinja tests
These tests were using the now-outdated method of looking in the
file_roots for cached templates in masterless mode.
2014-12-10 18:41:32 -06:00
Pedro Algarvio
aaf0f4aba0 Fix imports 2014-11-26 21:08:13 +00:00
Thomas S Hatch
e2d640962a Fix Jinja test 2014-09-23 14:02:34 -06:00
Thomas S Hatch
7355f53057 Add fileserver_backend to jinja tests local opts 2014-09-22 10:29:25 -06:00
Seth House
0d8cc41c61 Added tests for calling functions via Jinja with dot-lookup syntax
Yay!
2014-07-25 12:27:45 -06:00
Khris Richardson
1acd82f3f1 add sphinx spelling extension. enforce en_us 2014-07-13 13:43:33 -05:00
Erik Johnson
0104ccc400 Fix failing jinja unit tests
These began failing due to a recent change in the error reporting for
undefined jinja variables.
2014-06-12 14:33:53 -05:00
Seth House
c94cd38c65 Added unit test for the import_text tag 2014-03-06 17:30:47 -08:00
Pedro Algarvio
7a42bf24fc Jinja's sequence filter does not need to be an extension. 2014-02-15 17:26:35 +00:00
Xavier Barbosa
d7eb1d2f9d fix jinja SequenceExtension 2014-02-13 08:59:29 +01:00
Thomas S Hatch
a7baf5936c Revert "add sequence filter for jinja"
This reverts commit cbe04b8231.
2014-02-11 15:59:22 -07:00
Xavier Barbosa
cbe04b8231 add sequence filter for jinja 2014-02-11 20:42:40 +01:00
Pedro Algarvio
ec75329a88 Ignore and remove unused imports 2014-02-08 08:01:12 +00:00
Mathieu Le Marec - Pasquet
9a9eada12f Better trace for nested jinja errors 2014-01-03 18:16:11 +01:00
Thomas S Hatch
30c49e32c7 Revert "Better trace for nested jinja errors"
This reverts commit 78899493bb.
2013-12-31 12:22:24 -07:00
Thomas S Hatch
697bffcf1d Revert "division test fix"
This reverts commit 56bcfbb03c.
2013-12-31 12:22:13 -07:00
Mathieu Le Marec - Pasquet
56bcfbb03c division test fix 2013-12-31 14:34:29 +00:00
Mathieu Le Marec - Pasquet
78899493bb Better trace for nested jinja errors 2013-12-31 13:25:57 +00:00
Thomas S Hatch
5eaca79810 Revert "Better trace for nested jinja errors"
This reverts commit 99a2791917.
2013-12-30 11:32:53 -07:00
Mathieu Le Marec - Pasquet
99a2791917 Better trace for nested jinja errors 2013-12-25 18:00:15 +00:00
Pedro Algarvio
2648ed90ba Fix lint issues. 2013-12-09 20:02:25 +00:00
regilero
7d05551062 Manage errors containing utf-8 or unicode charcters at the jinja level 2013-12-05 18:46:43 +01:00
Pedro Algarvio
aa8ead9897 Remove duplicate method 2013-11-27 13:06:59 +00:00
Pedro Algarvio
0ae1a15c61 PEP8 E302 and E303 blank lines fixes. 2013-11-27 12:11:45 +00:00
Pedro Algarvio
d02a2bc224 Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
Pedro Algarvio
8ba59ea6c6 Adapt the tests to the latest Jinja2 template changes. 2013-11-14 01:21:57 +00:00
Pedro Algarvio
f4cba0d293 Deprecate env usage in favor of saltenv. 2013-11-12 01:01:50 +00:00
Xavier Barbosa
a5575aca13 deprecated assertEquals 2013-10-25 02:33:17 +02:00
Xavier Barbosa
a218aea003 fix jinja unittest 2013-10-25 02:33:16 +02:00
Xavier Barbosa
1309ef9887 fix jinja rendering of nested structures 2013-10-25 02:33:16 +02:00
Henrik Holmboe
77fd1acb7f Change assertEquals to assertEqual
According to
http://docs.python.org/2/library/unittest.html#deprecated-aliases
assertEquals is a deprecated alias of assertEqual.
2013-10-24 11:39:04 +02:00
Seth House
54cc36566e Added a pprint.pformat Jinja filter to match the file.serialize state 2013-10-16 09:23:14 -06:00
Pedro Algarvio
30e747060d Jinja needs to be "fed" Unicode data. Fixes #7576.
Additionally, what's returned from `render_jinja_tmpl` is also a Unicode string to that the `SLS_ENCODER` can properly encode them. Encoding UTF-8 data as UTF-8 data using the `SLS_ENCODER` does not, of course, work.
2013-10-08 00:11:44 +01:00
Pedro Algarvio
a5a87ca1fc Mimic the test case shown @ http://goo.gl/UI7uS8 2013-10-08 00:11:19 +01:00
Roberto Aguilar
ef968e7c64 Added tests for error template context. 2013-09-19 01:02:05 -07:00
Xavier Barbosa
c1b6e06a0f added load tag, and revamped parsing 2013-07-26 09:30:41 +02:00
Xavier Barbosa
11ef87bd5d finished cleanup 2013-07-19 16:53:51 +02:00
Xavier Barbosa
abd031963f removed anchored yaml, does not work with CDumper... 2013-07-19 16:50:59 +02:00
Xavier Barbosa
f8bf53b682 added doc for yaml / json tags 2013-07-19 16:02:29 +02:00
Xavier Barbosa
9288281c63 added to jinja load* filters and tags 2013-07-19 16:02:28 +02:00
Xavier Barbosa
117f76def4 added AnchoredDumper 2013-07-19 16:02:28 +02:00
Pedro Algarvio
db6553a019 Skip unit.templates.jinja_test.TestGetTemplate.test_strftime test if timelib is not installed. 2013-07-17 11:23:42 +01:00
Xavier Barbosa
22e1da9148 changed dateutil by timelib saltstack/salt#6088 2013-07-15 11:12:23 +02:00
Xavier Barbosa
00e373b63b added unittests for strftime filter saltstack/salt#6088 2013-07-15 11:12:21 +02:00
Xavier Barbosa
3f49000ba2 unittesting for file.serialize and yaml & json filters 2013-07-08 16:19:19 +02:00
Pedro Algarvio
d6049a92b5 Use an unicode aware context in the jinja render call. Refs #3436 2013-07-02 14:28:20 +01:00
Pedro Algarvio
4a875f5b35 Updated unit.templates.jinja_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
222be7b446 Make sure every test module is runnable by __main__.
* Double to single quotes
2013-06-28 00:12:56 +01:00
Michał Jarco
7f782afb14 Fixed jinja_tests.
File roots contains lists of paths for each env.
2013-01-14 08:58:27 +01:00
Jeroen Dekkers
c123d8f824 Preserve the final newline in Jinja templates 2012-12-02 19:45:09 +01:00
Pedro Algarvio
c5fe83272f Even more open() to salt.utils.fopen(). 2012-11-18 18:57:10 +00:00
Thomas S Hatch
326904e020 An easy fix on opening files 2012-11-13 20:55:40 -07:00
Jack Kuan
db451d5ed3 Update jinja template unit tests and remove obsolete salt.utils.jinja.get_template(). 2012-11-12 17:08:14 -05:00
Morgan Fainberg
7800157e37 Fix the test for jinja, local (non salt:// files) now can support {% include %} 2012-09-27 14:55:55 -07:00
Intchanter
a1433ef5ec PEP8 fixes for tests 2012-06-30 14:10:34 -06:00
David Boucha
bb72a4dfba Fix jinja_test on Windows 2012-06-24 18:16:22 -06:00
Baiju Muthukadan
24bb4ea4e0 Fix PEP8 warnings for test cases 2012-05-29 22:10:20 +05:30
Jeff Schroeder
6f836afafa Remove a few instances of hardcoded /tmp in code
tempfile.gettempdir() is way better. The gem and rvm states are
still failing, but only because they require the "mock" python
module for running their tests.
2012-05-09 21:29:05 -07:00
Anselm Helbig
5bc9ea7d67 added preliminary unit tests for rvm module 2012-05-02 09:42:01 +02:00
Eivind Uggedal
ab7ace6aa5 Split out integration tests from pure unit tests.
Integration tests requiring a salt master and daemon were seperated
from pure unit tests. For now both are run with runtest.py. In
the future it could take arguments for which type of tests to run.
2012-02-20 13:18:13 +01:00