Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_redisize_int(self):
self.assertEqual(Redisizer.redisize(10), b':10\r\n')
def test_redisize_text(self):
self.assertEqual(
Redisizer.redisize('☃'),
b'$3\r\n\xe2\x98\x83\r\n'
)
def test_redisize_command(self):
self.assertEqual(
Redisizer.redisize(Redisizer.command('OK')),
b'+OK\r\n'
)
def test_redisize_dict(self):
self.assertEqual(
Redisizer.redisize({'snowman': '☃'}),
b'*2\r\n$7\r\nsnowman\r\n$3\r\n\xe2\x98\x83\r\n'
)
def test_redisize_dict(self):
self.assertEqual(
Redisizer.redisize({'snowman': '☃'}),
b'*2\r\n$7\r\nsnowman\r\n$3\r\n\xe2\x98\x83\r\n'
)
def test_redisize_command(self):
self.assertEqual(
Redisizer.redisize(Redisizer.command('OK')),
b'+OK\r\n'
)
def test_redisize_text(self):
self.assertEqual(
Redisizer.redisize('☃'),
b'$3\r\n\xe2\x98\x83\r\n'
)