Example #1
0
 def test_register(self):
     Entry.register(('localhost', 6379), 'SET snowman "is ☃!"', OK)
     self.assertEqual(Mocket._entries[('localhost', 6379)][0].command, [
         b'*3', b'$3', b'SET', b'$7', b'snowman', b'$7', b'is \xe2\x98\x83!'
     ])
     self.assertEqual(
         Mocket._entries[('localhost', 6379)][0].responses[0].data,
         b'+OK\r\n')
Example #2
0
 def test_register(self):
     Entry.register(('localhost', 6379), 'SET snowman "is ☃!"', OK)
     self.assertEqual(
         Mocket._entries[('localhost', 6379)][0].command,
         [b'*3', b'$3', b'SET', b'$7', b'snowman', b'$7', b'is \xe2\x98\x83!']
     )
     self.assertEqual(
         Mocket._entries[('localhost', 6379)][0].responses[0].data,
         b'+OK\r\n'
     )
Example #3
0
 def test_register(self):
     Entry.register(("localhost", 6379), 'SET snowman "is ☃!"', OK)
     self.assertEqual(
         Mocket._entries[("localhost", 6379)][0].command,
         [
             b"*3", b"$3", b"SET", b"$7", b"snowman", b"$7",
             b"is \xe2\x98\x83!"
         ],
     )
     self.assertEqual(
         Mocket._entries[("localhost", 6379)][0].responses[0].data,
         b"+OK\r\n")