# -*- encoding: utf-8 -*-
from __future__ import (unicode_literals, absolute_import,
                        division, print_function)
"""
Collection of non-typespecific tests.
"""

import requests


class ServerTests():
    # TODO: doc me

    def check_accecpt_encoding(self, url):
        """
        Pass an url and check wether mandatory compressions are supported.

        Args:
            url: URL to some json

        Returns:
            True on success, false otherwise.
        """
        compressions = ["gzip", "compress", "deflate"]
        response = requests.get(
            url,
            {"Accept-Encoding": ", ".join(compressions)}
        )
        # response shall contain header w/ "Content-Encoding" wich must be
        # any of the above
        for compression in compressions:
            if compression in response.header["Content-Encoding"]:
                return True
        return False

@@ -19,16 +19,63 @@
 f-8 -*-%0A
+%22%22%22%0ACollection of non-typespecific tests.%0A%22%22%22%0A%0A
 from __f
@@ -179,118 +179,26 @@
 on)%0A
-%22%22%22%0ACollection of non-typespecific tests.%0A%22%22%22%0A%0Aimport requests%0A%0A%0Aclass ServerTests():%0A    # TODO: doc me%0A%0A    
+import requests%0A%0A%0A
 def 
@@ -224,14 +224,8 @@
 ing(
-self, 
 url)
@@ -226,36 +226,32 @@
 g(url):%0A    
- 
-   
 %22%22%22%0A    
     Pass an 
@@ -238,20 +238,16 @@
 %22%22%22%0A    
- 
-   
 Pass an 
@@ -306,20 +306,16 @@
 orted.%0A%0A
-    
     Args
@@ -316,20 +316,16 @@
   Args:%0A
-    
         
@@ -347,20 +347,16 @@
 e json%0A%0A
-    
     Retu
@@ -356,28 +356,24 @@
    Returns:%0A
-    
         True
@@ -406,28 +406,20 @@
 se.%0A    
-    %22%22%22%0A    
+%22%22%22%0A
     comp
@@ -469,65 +469,16 @@
     
-    response = requests.get(%0A            url,%0A           
+header =
  %7B%22A
@@ -527,18 +527,53 @@
     
-    )%0A    
+response = requests.get(url, header=header)%0A%0A
     
@@ -643,20 +643,16 @@
  be%0A    
-  
-  
 # any of
@@ -662,20 +662,16 @@
 e above%0A
-    
     for 
@@ -707,20 +707,16 @@
         
-   
- 
 if compr
@@ -770,28 +770,24 @@
             
-    
 return True%0A
@@ -786,20 +786,16 @@
 rn True%0A
-    
     retu

fix python style