Ejemplo n.º 1
0
    def test_longer_dict(self):
        """ Test that a longer dict is correctly seperated. """

        self.exp = "d5:key_17:value_15:key_27:value_2ei1e"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n],
                         "d5:key_17:value_15:key_27:value_2e")
Ejemplo n.º 2
0
    def test_simple_list(self):
        """ Test that simple lists are correctly seperated. """

        self.exp = "li1eei1e"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "li1ee")
Ejemplo n.º 3
0
    def test_nested_dict(self):
        """ Test that a nested dict is correctly seperated. """

        self.exp = "d3:subd3:key5:valueeei1e"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "d3:subd3:key5:valueee")
Ejemplo n.º 4
0
    def test_list_with_long_string(self):
        """ Test a list with a long string is seperated correctly. """

        self.exp = "l10:eggsandhame3:end"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "l10:eggsandhame")
Ejemplo n.º 5
0
    def test_nested_list(self):
        """ Test a nested list is seperated correctly. """

        self.exp = "li1eli2eei3eeli1ee"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "li1eli2eei3ee")
Ejemplo n.º 6
0
    def test_longer_list(self):
        """ Test that longer lists are correctly seperated. """

        self.exp = "li1ei2eei1e"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "li1ei2ee")
Ejemplo n.º 7
0
    def test_list_with_string(self):
        """ Test that simple list with a string is seperated. """

        self.exp = "l4:teste3:end"
        self.n = bencode.walk(self.exp, 1)
        self.assertEqual(self.exp[:self.n], "l4:teste")
Ejemplo n.º 8
0
	def test_nested_dict(self):
		""" Test that a nested dict is correctly seperated. """

		self.exp = "d3:subd3:key5:valueeei1e"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "d3:subd3:key5:valueee")
Ejemplo n.º 9
0
	def test_simple_list(self):
		""" Test that simple lists are correctly seperated. """

		self.exp = "li1eei1e"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "li1ee")
Ejemplo n.º 10
0
	def test_longer_dict(self):
		""" Test that a longer dict is correctly seperated. """

		self.exp = "d5:key_17:value_15:key_27:value_2ei1e"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "d5:key_17:value_15:key_27:value_2e")
Ejemplo n.º 11
0
	def test_nested_list(self):
		""" Test a nested list is seperated correctly. """

		self.exp = "li1eli2eei3eeli1ee"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "li1eli2eei3ee")
Ejemplo n.º 12
0
	def test_list_with_long_string(self):
		""" Test a list with a long string is seperated correctly. """

		self.exp = "l10:eggsandhame3:end"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "l10:eggsandhame")
Ejemplo n.º 13
0
	def test_list_with_string(self):
		""" Test that simple list with a string is seperated. """

		self.exp = "l4:teste3:end"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "l4:teste")
Ejemplo n.º 14
0
	def test_longer_list(self):
		""" Test that longer lists are correctly seperated. """

		self.exp = "li1ei2eei1e"
		self.n = bencode.walk(self.exp, 1)
		self.assertEqual(self.exp[:self.n], "li1ei2ee")