Wie man http-Server unter Python mockt

Führt der eigene Code http-Calls aus, z.B. um Dateien von einem externen Server runterzuladen stellt sich die Frage nach der Testbarkeit. Idealerweise ist der Code so aufgebaut, daß er nicht direkt von einer http-Library abhängt und man entsprechende Calls mocken kann. Ist dies nicht einfach möglich, kann man den in der Standarlibrary eingebauten http.server als localhost-Gegenstelle für Tests verwenden.

Continue reading “Wie man http-Server unter Python mockt”

Jenkins and case sensitive environment variables

Some tools demand environment variables to be present in a certain case. E.g. some libraries read out the proxy configuration in the environment variable HTTP_PROXY (all uppercase), while some refer to the lower case variant http_proxy. An example of the later is libcurl. So in any case you want to set both variants.

Unfortunately Jenkins has some problems passing all variants from the build host environment and is mixing up things. It doesn’t seem that the problem is fixed anytime soon.

Continue reading “Jenkins and case sensitive environment variables”