def test_get_no_healings(self, token_is_valid, get):
     token_is_valid.return_value = True
     resp = Mock()
     resp.json.return_value = None
     get.return_value = resp
     request = self.factory.get("/dashboard/healing_status")
     request.session = {"tsuru_token": "sometoken"}
     response = HealingView.as_view()(request)
     self.assertEqual(200, response.status_code)
     result = json.loads(response.content)
     self.assertEqual({"healing": 0}, result)
示例#2
0
 def test_get_no_healings(self, token_is_valid, get):
     token_is_valid.return_value = True
     resp = Mock()
     resp.json.return_value = None
     get.return_value = resp
     request = self.factory.get("/dashboard/healing_status")
     request.session = {"tsuru_token": "sometoken"}
     response = HealingView.as_view()(request)
     self.assertEqual(200, response.status_code)
     result = json.loads(response.content)
     self.assertEqual({"healing": 0}, result)
 def test_get_no_healings_today(self, token_is_valid, get):
     token_is_valid.return_value = True
     resp = Mock()
     resp.json.return_value = [
         {"EndTime": "2012-03-31T12:10:15Z"},
         {"EndTime": "2012-03-31T09:02:15-0300"},
         {"EndTime": "2012-03-31T00:02:15-0800"},
     ]
     get.return_value = resp
     request = self.factory.get("/dashboard/healing_status")
     request.session = {"tsuru_token": "sometoken"}
     response = HealingView.as_view()(request)
     self.assertEqual(200, response.status_code)
     result = json.loads(response.content)
     self.assertEqual({"healing": 0}, result)
示例#4
0
 def test_get_no_healings_today(self, token_is_valid, get):
     token_is_valid.return_value = True
     resp = Mock()
     resp.json.return_value = [
         {
             "EndTime": "2012-03-31T12:10:15Z"
         },
         {
             "EndTime": "2012-03-31T09:02:15-0300"
         },
         {
             "EndTime": "2012-03-31T00:02:15-0800"
         },
     ]
     get.return_value = resp
     request = self.factory.get("/dashboard/healing_status")
     request.session = {"tsuru_token": "sometoken"}
     response = HealingView.as_view()(request)
     self.assertEqual(200, response.status_code)
     result = json.loads(response.content)
     self.assertEqual({"healing": 0}, result)