| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 1 | # A simple test to verify we're using the right libjuju module |
| 2 | from n2vc.vnf import N2VC # noqa: F401 |
| 3 | import sys |
| 4 | |
| 5 | |
| 6 | def test_libjuju(): |
| 7 | """Test the module import for our vendored version of libjuju. |
| 8 | |
| 9 | Test and verify that the version of libjuju being imported by N2VC is our |
| 10 | vendored version, not one installed externally. |
| 11 | """ |
| 12 | for name in sys.modules: |
| 13 | if name.startswith("juju"): |
| 14 | module = sys.modules[name] |
| 15 | if getattr(module, "__file__"): |
| 16 | assert module.__file__.find("N2VC/modules/libjuju/juju") |
| 17 | |
| 18 | return |