示例#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")
示例#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")
示例#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")
示例#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")
示例#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")
示例#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")
示例#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")
	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")
	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")
	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")
	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")
	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")
	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")
	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")