diff options
| author | Daniel Watkins <daniel.watkins@canonical.com> | 2018-06-08 15:21:50 -0700 | 
|---|---|---|
| committer | Daniel Watkins <daniel.watkins@canonical.com> | 2018-06-08 15:22:53 -0700 | 
| commit | a9d231a6d5aa7c7af3c2ab0b53524b17460b7cd7 (patch) | |
| tree | 288454599f054f460e2fd96c26c4f52f8bd812cd | |
| parent | fcfedb5242e5b1b51c8422735788ed5f68b62f3c (diff) | |
Add single test and use it to configure tox
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | test-requirements.txt | 1 | ||||
| -rw-r--r-- | tests.py | 9 | ||||
| -rw-r--r-- | tox.ini | 12 | 
4 files changed, 25 insertions, 0 deletions
| diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a0ce11 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.mypy_cache +.pytest_cache +.tox diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..e079f8a --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +pytest diff --git a/tests.py b/tests.py new file mode 100644 index 0000000..bacfbf1 --- /dev/null +++ b/tests.py @@ -0,0 +1,9 @@ +import mfdiff + + +class TestManifestToDict(object): + + def test_empty_file_returns_empty_dict(self, tmpdir): + manifest_file = tmpdir.join('manifest') + manifest_file.write('') + assert mfdiff.manifest_to_dict(str(manifest_file)) == {} @@ -0,0 +1,12 @@ +[tox] +envlist = py27 +skip_install=true +skipsdist=true + +[testenv] +deps= + -rtest-requirements.txt +commands= + pytest tests.py +# We need sitepackages because python-apt isn't in PyPI +sitepackages=true | 
