예제 #1
0
    def get(self):
        response = cache.status_message()
        cache_keys = cache.keys("")
        if cache_keys:
            response += "<br>Cached keys:<br>"
            response += "<br>".join(cache_keys)
        else:
            response += "<br>There are no cached keys"

        self.write(response)
예제 #2
0
    def get(self):
        response = cache.status_message()
        cache_keys = cache.keys("")
        if cache_keys:
            response += "<br>Cached keys:<br>"
            response += "<br>".join(cache_keys)
        else:
            response += "<br>There are no cached keys"

        self.write(response)
예제 #3
0
 def test_status_exception_connection(self, ping):
     response = status_message()
     expected = "Redis connection authenticated [:None] | FAILED | localhost:6379 | Traceback (most recent call last)"
     self.assertIn(expected, response)
예제 #4
0
 def test_status_fail(self, mock_get_usage_message, mock_ping):
     response = status_message()
     expected = 'Redis connection authenticated [:None] | FAILED | localhost:6379 | Ping failed'
     self.assertEqual(response, expected)
예제 #5
0
 def test_status_success(self, ping):
     response = status_message()
     expected = 'Redis connection authenticated'
     self.assertIn(expected, response)
예제 #6
0
 def test_status_exception_connection(self, ping):
     response = status_message()
     expected = "Redis connection authenticated [:None] | FAILED | localhost:6379 | Traceback (most recent call last)"
     self.assertIn(expected, response)
예제 #7
0
 def test_status_fail(self, mock_get_usage_message, mock_ping):
     response = status_message()
     expected = 'Redis connection authenticated [:None] | FAILED | localhost:6379 | Ping failed'
     self.assertEqual(response, expected)
예제 #8
0
 def test_status_success(self, ping):
     response = status_message()
     expected = 'Redis connection authenticated'
     self.assertIn(expected, response)