示例#1
0
 def test_proxy_remote(self):
     result = list(nginx.extract_sites(self.multiple_example))
     pprint(result)
     specific_site = [
         site for site in result if site["name"] == "api.ddsc.nl"
     ][0]
     self.assertEqual(specific_site["proxy_to_other_server"],
                      "110-haprox-d2.ourdomain")
示例#2
0
 def test_redirect_protocol(self):
     result = list(nginx.extract_sites(self.redirect_example))
     pprint(result)
     self.assertEqual(result[0]["redirect_to_protocol"], "https")
示例#3
0
 def test_redirect_target(self):
     result = list(nginx.extract_sites(self.redirect_example))
     pprint(result)
     self.assertEqual(result[0]["redirect_to"], "uploadservice.lizard.net")
示例#4
0
 def test_redirect_count(self):
     result = list(nginx.extract_sites(self.redirect_example))
     pprint(result)
     self.assertEqual(len(result), 1)
示例#5
0
 def test_proxy_local(self):
     result = list(nginx.extract_sites(self.single_example))
     pprint(result)
     self.assertEqual(result[0]["proxy_to_local_port"], "9070")
示例#6
0
 def test_protocol_https(self):
     result = list(nginx.extract_sites(self.multiple_example))
     pprint(result)
     self.assertEqual(result[0]["protocol"], "https")
示例#7
0
 def test_regex_count(self):
     # Weird lizard5-only regex magic.
     result = list(nginx.extract_sites(self.regex_example))
     pprint(result)
     self.assertEqual(len(result), 3)
示例#8
0
 def test_multiple_count(self):
     # Two server parts, one with a double name.
     result = list(nginx.extract_sites(self.multiple_example))
     pprint(result)
     self.assertEqual(len(result), 3)