예제 #1
0
    def test_long_string(self):
        """ Test that a long string is encoded correctly. """

        self.n = bencode.encode_str("averylongstring")
        self.assertEqual(self.n, "15:averylongstring")
예제 #2
0
    def test_string(self):
        """ Test that a string is encoded correctly. """

        self.n = bencode.encode_str("test")
        self.assertEqual(self.n, "4:test")
예제 #3
0
    def test_character(self):
        """ Test that a single character is encoded correctly. """

        self.n = bencode.encode_str("a")
        self.assertEqual(self.n, "1:a")
예제 #4
0
	def test_long_string(self):
		""" Test that a long string is encoded correctly. """

		self.n = bencode.encode_str("averylongstring")
		self.assertEqual(self.n, "15:averylongstring")
예제 #5
0
	def test_string(self):
		""" Test that a string is encoded correctly. """

		self.n = bencode.encode_str("test")
		self.assertEqual(self.n, "4:test")
예제 #6
0
	def test_character(self):
		""" Test that a single character is encoded correctly. """

		self.n = bencode.encode_str("a")
		self.assertEqual(self.n, "1:a")