d53bd2e Use factory for requests session objects

Authored and Committed by nphilipp 3 years ago
    Use factory for requests session objects
    
    The `make_session()` factory creates session objects with default values
    for timeouts, number of retries, etc., which can be overridden when
    calling it.
    
    Create such (long-lived) session objects in the constructors of the
    individual toddlers using requests to access remote APIs. Pull in
    module-global functions into the toddler class where necessary and adapt
    tests to accommodate.
    
    Also, mock out the factory function in the `toddler´ fixture for testing.
    
    Signed-off-by: Nils Philippsen <nils@redhat.com>
    
        
file modified
+14 -0