Exemple #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")
Exemple #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")
Exemple #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")
Exemple #4
0
 def test_redirect_count(self):
     result = list(nginx.extract_sites(self.redirect_example))
     pprint(result)
     self.assertEqual(len(result), 1)
Exemple #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")
Exemple #6
0
 def test_protocol_https(self):
     result = list(nginx.extract_sites(self.multiple_example))
     pprint(result)
     self.assertEqual(result[0]["protocol"], "https")
Exemple #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)
Exemple #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)