Example #1
0
 def _print_request(self, method, url, params=None, data=None):
     if debug.will_print_for(debug.INFO):
         print(u"{0}{1}".format(str(method).ljust(8), url))
     if debug.will_print_for(debug.TRACE):
         if self.headers:
             _print_dict(self.headers, u"  headers")
     if debug.will_print_for(debug.DEBUG):
         if params:
             _print_dict(params, u"  params")
         if data:
             _print_dict(data, u"  data")
Example #2
0
def test_will_print_for_given_debug_enabled_with_undefined_level_returns_false(
        debug_enabled, level):
    assert not debug.will_print_for(level)
Example #3
0
def test_will_print_for_given_debug_enabled_with_level_higher_than_debug_returns_false(
        debug_enabled, level):
    assert not debug.will_print_for(level)
Example #4
0
def test_will_print_for_given_trace_enabled_with_level_lower_than_or_equal_to_trace_returns_true(
        trace_enabled, level):
    assert debug.will_print_for(level)
Example #5
0
def test_will_print_for_given_none_enabled_with_none_returns_true(
        none_enabled, level):
    assert debug.will_print_for(level)