示例#1
0
    def test_get_servers(self):
        params = {"cluster": "East"}
        request = self.factory.get("/get_servers", params)
        self.response = views.get_servers(request)

        # Verify content
        expected = json.dumps(["ec2-54-242-160-13.compute-1.amazonaws.com"])
        self.assertEquals(self.response.content, expected)
示例#2
0
 def test_get_servers_wrong_param(self):
     params = {"cluster": "West"}
     request = self.factory.get("/get_servers", params)
     self.response = views.get_servers(request)
示例#3
0
 def test_get_servers_with_missing_param(self):
     request = self.factory.get("/get_servers")
     self.response = views.get_servers(request)