Python codecs.charbuffer_encode() Examples

The following are 19 code examples of codecs.charbuffer_encode(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module codecs , or try the search function .
Example #1
Source File: test_codecs.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #2
Source File: test_codecs.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #3
Source File: test_codecs.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0)) 
Example #4
Source File: test_codecs.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #5
Source File: test_codecs.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #6
Source File: test_codecs.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0)) 
Example #7
Source File: test_codecs.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #8
Source File: test_codecs.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #9
Source File: test_codecs.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0)) 
Example #10
Source File: test_codecs.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #11
Source File: test_codecs.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #12
Source File: test_codecs.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0)) 
Example #13
Source File: test_codecs.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #14
Source File: test_codecs.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #15
Source File: test_codecs.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0)) 
Example #16
Source File: test_codecs.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_string(self):
        self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4)) 
Example #17
Source File: test_codecs.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_charbuffer_encode(self):
        if is_cli:
            self.assertRaises(NotImplementedError, codecs.charbuffer_encode, "abc") 
Example #18
Source File: test_codecs.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_bad_args(self):
        self.assertRaises(TypeError, codecs.charbuffer_encode)
        self.assertRaises(TypeError, codecs.charbuffer_encode, 42) 
Example #19
Source File: test_codecs.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_empty(self):
        self.assertEqual(codecs.charbuffer_encode(""), ("", 0))