salt/tests/zypp_plugin.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.1 KiB
Python
Raw Normal View History

2017-06-21 10:09:11 +01:00
# -*- coding: utf-8 -*-
2020-04-02 20:10:20 -05:00
"""
Related to zypp_plugins_test.py module.
2020-04-02 20:10:20 -05:00
"""
class Plugin(object):
2020-04-02 20:10:20 -05:00
"""
Bogus module for Zypp Plugins tests.
2020-04-02 20:10:20 -05:00
"""
def ack(self):
2020-04-02 20:10:20 -05:00
"""
Acknowledge that the plugin had finished the transaction
Returns:
2020-04-02 20:10:20 -05:00
"""
def main(self):
2020-04-02 20:10:20 -05:00
"""
Register plugin
Returns:
2020-04-02 20:10:20 -05:00
"""
class BogusIO(object):
2020-04-02 20:10:20 -05:00
"""
Read/write logger.
2020-04-02 20:10:20 -05:00
"""
def __init__(self):
self.content = list()
self.closed = False
def __str__(self):
return "\n".join(self.content)
def __call__(self, *args, **kwargs):
self.path, self.mode = args
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
def __enter__(self):
return self
def write(self, data):
2020-04-02 20:10:20 -05:00
"""
Simulate writing data
Args:
data:
Returns:
2020-04-02 20:10:20 -05:00
"""
self.content.append(data)
def close(self):
2020-04-02 20:10:20 -05:00
"""
Simulate closing the IO object.
Returns:
2020-04-02 20:10:20 -05:00
"""
self.closed = True