Commit Graph

5 Commits

Author SHA1 Message Date
Hervé Beraud 41d36e8b2e Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: Ie62d7878f7b952f35ca854cc36ee55b62af5f8c1
2021-12-15 10:26:53 +00:00
James Page 5174ce1201 Misc tidy of lint
Remove upper bound on flake8 and tidy misc lint on codebase.

Note that one of the warning messages signalled that a parameter
was not used in a format call. This may or may not be correct
but this commit sticks with the existing behaviour.

Change-Id: Ifa178694a97997f992afa88f4a8f3bead09ced3b
2020-07-21 09:12:11 +01:00
Alex Kavanagh 5317a5d41f Use charms.openstack charmhelpers test_mocks
Every reactive charm that uses charms.openstack and implements unit
testing needs to mock charmhelpers, as otherwise the tests blow up.
This patch uses the mocking of charmhelpers in charms.openstack so that
a charm layer can just import test_mocks and charmhelpers will be mocked
out along with setting up a default
charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
derived charm class won't fail on definition.

Change-Id: Ia9744ea95f0766769daa8e8c31d422ee79c3afc5
Related-Bug: #1693017
Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166
2017-05-25 11:03:15 +01:00
Ryan Beisner 021c2a609c Add .gitreview and clean up repo
Add src/README.md placeholder to prevent inheritence of the
base layer's readme file in the built charm.

Use the official charms.openstack repo in test-requirements.txt.

Use official designate charm location in the Amulet tests.

Remove upload-and-publish so as not to encourage out-of-band
pushing and publishing.  That is handled by CI.

Remove legacy Makefile.

Rename Amulet test files and drop Icehouse on the Trusty target.

Update tox.ini for Amulet environment variables.

Update metadata.yaml, removing EOL release and adding tags.

Fix apt_pkg mock

Disable py27 unit tests

Change-Id: I5220b73eb41e42cb03e6dac27525140fb21ca449
2016-07-22 14:53:32 +00:00
Liam Young 51b9f62307 Add unit tests 2016-07-08 12:35:52 +01:00