Exemplo n.º 1
0
    def test_mixed_complex(self):
        """ Test that a mixed complex expression is inflated correctly. """

        self.n = bencode.inflate("li1ei2eed3:key5:valuee")
        self.assertEqual(self.n, ["li1ei2ee", "d3:key5:valuee"])
Exemplo n.º 2
0
    def test_long_string(self):
        """ Test that an expression containing a long string is
		inflated correctly. """

        self.n = bencode.inflate("i1e15:averylongstringi2e")
        self.assertEqual(self.n, ["i1e", "15:averylongstring", "i2e"])
Exemplo n.º 3
0
    def test_mixed_simple(self):
        """ Test that a mixed simple expression is inflated correctly. """

        self.n = bencode.inflate("3:onei1e3:twoi2e")
        self.assertEqual(self.n, ["3:one", "i1e", "3:two", "i2e"])
Exemplo n.º 4
0
    def test_simple(self):
        """ Test that a simple expression is inflated correctly. """

        self.n = bencode.inflate("i1e")
        self.assertEqual(self.n, ["i1e"])
Exemplo n.º 5
0
    def test_longer(self):
        """ Test that a longer expression is inflated correctly. """

        self.n = bencode.inflate("i1ei2ei3e")
        self.assertEqual(self.n, ["i1e", "i2e", "i3e"])
Exemplo n.º 6
0
	def test_mixed_complex(self):
		""" Test that a mixed complex expression is inflated correctly. """

		self.n = bencode.inflate("li1ei2eed3:key5:valuee")
		self.assertEqual(self.n, ["li1ei2ee", "d3:key5:valuee"])
Exemplo n.º 7
0
	def test_mixed_simple(self):
		""" Test that a mixed simple expression is inflated correctly. """

		self.n = bencode.inflate("3:onei1e3:twoi2e")
		self.assertEqual(self.n, ["3:one", "i1e", "3:two", "i2e"])
Exemplo n.º 8
0
	def test_long_string(self):
		""" Test that an expression containing a long string is
		inflated correctly. """

		self.n = bencode.inflate("i1e15:averylongstringi2e")
		self.assertEqual(self.n, ["i1e", "15:averylongstring", "i2e"])
Exemplo n.º 9
0
	def test_longer(self):
		""" Test that a longer expression is inflated correctly. """

		self.n = bencode.inflate("i1ei2ei3e")
		self.assertEqual(self.n, ["i1e", "i2e", "i3e"])
Exemplo n.º 10
0
	def test_simple(self):
		""" Test that a simple expression is inflated correctly. """

		self.n = bencode.inflate("i1e")
		self.assertEqual(self.n, ["i1e"])