diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/mozharness/test/test_mozilla_automation.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozharness/test/test_mozilla_automation.py')
-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() |