示例#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)