<commit_before>import unittest
import bmemcached
import bz2

class MemcachedTests(unittest.TestCase):
    def setUp(self):
        self.server = '127.0.0.1:11211'
        self.client = bmemcached.Client(self.server, 'user', 'password')
        self.bzclient = bmemcached.Client(self.server, 'user', 'password', bz2)
        self.data = b'this is test data. ' * 32

    def tearDown(self):
        self.client.delete(b'test_key')
        self.client.delete(b'test_key2')
        self.client.disconnect_all()
        self.bzclient.disconnect_all()

    def testCompressedData(self):
        self.client.set(b'test_key', self.data)
        self.assertEqual(self.data, self.client.get(b'test_key'))

    def testBZ2CompressedData(self):
        self.bzclient.set(b'test_key', self.data)
        self.assertEqual(self.data, self.bzclient.get(b'test_key'))

    def testCompressionMissmatch(self):
        self.client.set(b'test_key', self.data)
        self.bzclient.set(b'test_key2', self.data)
        self.assertEqual(self.client.get(b'test_key'),
                self.bzclient.get(b'test_key2'))
        with self.assertRaises(IOError):
            self.bzclient.get(b'test_key')
<commit_msg>fix python2.6 failure with assertRaises syntax<commit_after>import unittest
import bmemcached
import bz2

class MemcachedTests(unittest.TestCase):
    def setUp(self):
        self.server = '127.0.0.1:11211'
        self.client = bmemcached.Client(self.server, 'user', 'password')
        self.bzclient = bmemcached.Client(self.server, 'user', 'password', bz2)
        self.data = b'this is test data. ' * 32

    def tearDown(self):
        self.client.delete(b'test_key')
        self.client.delete(b'test_key2')
        self.client.disconnect_all()
        self.bzclient.disconnect_all()

    def testCompressedData(self):
        self.client.set(b'test_key', self.data)
        self.assertEqual(self.data, self.client.get(b'test_key'))

    def testBZ2CompressedData(self):
        self.bzclient.set(b'test_key', self.data)
        self.assertEqual(self.data, self.bzclient.get(b'test_key'))

    def testCompressionMissmatch(self):
        self.client.set(b'test_key', self.data)
        self.bzclient.set(b'test_key2', self.data)
        self.assertEqual(self.client.get(b'test_key'),
                self.bzclient.get(b'test_key2'))
        self.assertRaises(IOError, self.bzclient.get, b'test_key')

{'fraction_non_alphanumeric': 0.13427856547122602, 'fraction_numerical': 0.016680567139282735, 'mean_word_length': 3.143350604490501, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2852537', 'n_tokens_mistral': 846, 'n_tokens_neox': 807, 'n_words': 117}