summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
AgeCommit message (Collapse)Author
2015-02-25move towards user-data being binaryScott Moser
UrlResponse: biggest change... make readurl return bytes, making user know what to do with it. util: add load_tfile_or_url for loading text file or url as read_file_or_url now returns bytes ec2_utils: all meta-data is text, remove non-obvious string translations DigitalOcean: adjust for ec2_utils DataSourceGCE, DataSourceMAAS: user-data is binary other fields are text. openstack.py: read paths without decoding to text. This is ok as paths other than user-data are json, and load_json will handle load_file still returns text, and that is what most things use.
2015-02-18Read ovf-env.xml as bytes.Daniel Watkins
This should fix the Azure data source on Python 3, and is appropriate as XML shouldn't really be read as a string.
2015-02-11Add helpers for patching open and stdout/stderr.Daniel Watkins
2015-02-10make bddeb work with python3 or python2Scott Moser
painful, and not perfect, but at this point the output builds on a vivid system python2 (bddeb --python2) or python3. * remove use of cheetah by bddeb in favor of builtin renderer * add '--python2' flag to bddeb and knowledge of python 2 and python3 package names. * read-dependencies can now read test-requirements also. * differenciate from build-requirements and runtime requirements.
2015-01-26super() works in all of Python 2.6, 2.7, and 3.4.Barry Warsaw
2015-01-26Repair the Python 2.6 tests.Barry Warsaw
2015-01-26Trunk merged and ported.Barry Warsaw
2015-01-26More test repairs.Barry Warsaw
2015-01-22Low hanging Python 3 fruit.Barry Warsaw
2015-01-22Clean up.Barry Warsaw
2015-01-22Convert helpers.py and test_data.py from mocker to mock.Barry Warsaw
2015-01-22Port test__init__.py to unittest.mock.Barry Warsaw
2014-10-30Fix the digital ocean test on py2.6Joshua Harlow
The digital ocean datasource test is using assertIs which is only created/existent on py2.7, so for the older py2.6 we need to add similar logic so that the test works correctly there.
2014-07-23fix httpretty based test cases if http_proxy is set.Scott Moser
previously this would fail: http_proxy=http://foo.bar make test now it will pass. This works around a bug where httpretty is not able to patch http operations if http_proxy is set. https://github.com/gabrielfalcao/HTTPretty/issues/122
2014-07-16Fix a few tests that have been failing in python 2.6Joshua Harlow
A few of the current tests have been continually failing in python 2.6 based systems, due to lack of unit test functions that are now added to ensure we can run the unit tests (and not have to ignore those failures) on python 2.6
2014-02-07Adjust detection of python versions and variables exposedJoshua Harlow
2014-02-07Add a bunch of new testsJoshua Harlow
2014-01-27populate_dir: only makedir if it doesn't existScott Moser
2013-06-25Add unit tests for SLES handlerJuerg Haefliger
2013-03-08Enable the merging.txt to be in .rst format for public viewingJoshua Harlow
2013-03-07pep8 and pylint fixesScott Moser
2013-02-07more test cases for nocloud including one for config seedScott Moser
2013-01-10Add a context manager function in test helpers.harlowja
This function can be used to ensure that mocker objects are restored and verified during usage if exceptions are thrown while the mock object is being used. Ensure it is used in the config drive test when multiple mock objects are being created and restored. LP: #1098430
2012-11-13Create a utility testcase class that fixes some of the 2.6 missing piecesJoshua Harlow
- Add a helper testcase class that can add additional features into the unit test class as we need for features that are useful to have which starts with features that are missing including assertIn and assertNotIn LP: #1078473
2012-11-10Sudoers.d creation cleanups + tests.Joshua Harlow
2012-10-23use only util methods for reading/loading/appending/peekingScott Moser
Use only util methods for reading/loading/appending/peeking at files since it is likely soon that we will add a new way of adjusting the root of files read, also it is useful for debugging to track what is being read/written in a central fashion.
2012-09-26Adjust comment.Joshua Harlow
2012-09-26Fixup some pylint warnings.Joshua Harlow
2012-09-26Add a new example test that will patch utils and osJoshua Harlow
functions so that they can be 'retargeted' to a temporary directory, which allows us the ability to run a full set of cloud-init stages. Neat things: 1. All cloud-init code is unchanged (as long as it goes through the utils functions for most functionality) 2. Allows for a natural way to setup a temporary directory then patch the new directory as the new 'root' and then run cloud-init stages and then check the contents of what was placed as desired.
2012-08-31Fix pylint complaints.Joshua Harlow
2012-08-311. Add a helper for tests to use to load resource/data files fromJoshua Harlow
2. Add a set of tests+data that ensure the launch index filtering works as expected in the various modes including raw yaml and via mime/email message formats.