apache_beam.testing.test_utils module¶
Utility methods for testing
For internal use only; no backwards-compatibility guarantees.
-
class
apache_beam.testing.test_utils.
TempDir
[source]¶ Bases:
future.types.newobject.newobject
Context Manager to create and clean-up a temporary directory.
-
apache_beam.testing.test_utils.
compute_hash
(content, hashing_alg='sha1')[source]¶ Compute a hash value from a list of string.
-
apache_beam.testing.test_utils.
patch_retry
(testcase, module)[source]¶ A function to patch retry module to use mock clock and logger.
Clock and logger that defined in retry decorator will be replaced in test in order to skip sleep phase when retry happens.
Parameters: - testcase – An instance of unittest.TestCase that calls this function to patch retry module.
- module – The module that uses retry and need to be replaced with mock clock and logger in test.
-
apache_beam.testing.test_utils.
wait_for_subscriptions_created
(subs, timeout=60)[source]¶ Wait for all PubSub subscriptions are created.
-
apache_beam.testing.test_utils.
wait_for_topics_created
(topics, timeout=60)[source]¶ Wait for all PubSub topics are created.