Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")