Skip to content

Commit

Permalink
💚(project) fix apps lookup plugin test
Browse files Browse the repository at this point in the history
Since Ansible 4.8.0 upgrade, lookup list is not longer alphabetically
sorted.

Obliged to fix and version this in a separated commit or else renovate
will drop those changes.
  • Loading branch information
jmaupetit committed Nov 8, 2021
1 parent da7b9b9 commit 03e5872
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
line_length=88
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- Upgrade `ansible` to `4.8.0`

## [6.6.0] - 2021-10-28

### Added
Expand Down
9 changes: 6 additions & 3 deletions tests/units/plugins/lookup/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

import unittest

from pyfakefs.fake_filesystem_unittest import \
TestCaseMixin as fakefsTestCaseMixin
from pyfakefs.fake_filesystem_unittest import TestCaseMixin as fakefsTestCaseMixin

from lookup_plugins.apps import LookupModule as AppsLookupModule

Expand Down Expand Up @@ -221,7 +220,11 @@ def test_get_app_services(self):
"environment_variables": "apps/learninglocker/templates/services/xapi/_env.yml.j2",
},
]
self.assertEqual(lkp._get_app_services(app_path), expected)

self.assertEqual(
sorted(lkp._get_app_services(app_path), key=lambda x: x.get("name")),
expected,
)

def test_get_app_services_ignore_non_directories(self):
"""Test that the _get_app_services method only consider directories
Expand Down

0 comments on commit 03e5872

Please sign in to comment.