diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/mozharness/test/test_mozilla_automation.py | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream/1%115.7.0.tar.xz thunderbird-upstream/1%115.7.0.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | testing/mozharness/test/test_mozilla_automation.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/mozharness/test/test_mozilla_automation.py b/testing/mozharness/test/test_mozilla_automation.py new file mode 100644 index 0000000000..e76fec0249 --- /dev/null +++ b/testing/mozharness/test/test_mozilla_automation.py @@ -0,0 +1,45 @@ +import gc +import unittest + +import mozharness.base.log as log +import mozharness.base.script as script +from mozharness.base.log import ERROR +from mozharness.mozilla.automation import AutomationMixin + + +class CleanupObj(script.ScriptMixin, log.LogMixin): + def __init__(self): + super(CleanupObj, self).__init__() + self.log_obj = None + self.config = {"log_level": ERROR} + + +def cleanup(): + gc.collect() + c = CleanupObj() + for f in ("test_logs", "test_dir", "tmpfile_stdout", "tmpfile_stderr"): + c.rmtree(f) + + +class AutomationScript(AutomationMixin, script.BaseScript): + def __init__(self, **kwargs): + super(AutomationScript, self).__init__(**kwargs) + + +# TestAutomationStatus {{{1 +class TestAutomationStatus(unittest.TestCase): + # I need a log watcher helper function, here and in test_log. + def setUp(self): + cleanup() + self.s = None + + def tearDown(self): + # Close the logfile handles, or windows can't remove the logs + if hasattr(self, "s") and isinstance(self.s, object): + del self.s + cleanup() + + +# main {{{1 +if __name__ == "__main__": + unittest.main() |