X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fbase.py;h=8ea51092d5129c85bb2375f87a56c8f92148cd31;hb=refs%2Ftags%2F0.4.0;hp=292d04a755257dc121135bf35048ed390818eaf7;hpb=0f8958d1a9861ca196c613c3f1940aa61c4ddc33;p=osm%2FN2VC.git diff --git a/tests/base.py b/tests/base.py index 292d04a..8ea5109 100644 --- a/tests/base.py +++ b/tests/base.py @@ -19,6 +19,19 @@ bootstrapped = pytest.mark.skipif( reason='bootstrapped Juju environment required') +class CleanController(): + def __init__(self): + self.controller = None + + async def __aenter__(self): + self.controller = Controller() + await self.controller.connect_current() + return self.controller + + async def __aexit__(self, exc_type, exc, tb): + await self.controller.disconnect() + + class CleanModel(): def __init__(self): self.controller = None