Exemplo n.º 1
0
    def test_multiple_peers(self):
        """ Test that a two peer list is decoded correctly. """

        self.p = torrent.decode_binary_peers("dddd\x03\xe8dddd\x03\xe8")
        self.assertEqual(self.p, [('100.100.100.100', 1000), \
         ('100.100.100.100', 1000)])
Exemplo n.º 2
0
    def test_single_peer(self):
        """ Test that a one peer list is decoded. """

        self.p = torrent.decode_binary_peers("dddd\x03\xe8")
        self.assertEqual(self.p, [("100.100.100.100", 1000)])
Exemplo n.º 3
0
    def test_zero_peer(self):
        """ Test that a zero peer list is decoded correctly. """

        self.p = torrent.decode_binary_peers([])
        self.assertEqual(self.p, [])
Exemplo n.º 4
0
	def test_multiple_peers(self):
		""" Test that a two peer list is decoded correctly. """

		self.p = torrent.decode_binary_peers("dddd\x03\xe8dddd\x03\xe8")
		self.assertEqual(self.p, [('100.100.100.100', 1000), \
			('100.100.100.100', 1000)])
Exemplo n.º 5
0
	def test_single_peer(self):
		""" Test that a one peer list is decoded. """

		self.p = torrent.decode_binary_peers("dddd\x03\xe8")
		self.assertEqual(self.p, [("100.100.100.100", 1000)])
Exemplo n.º 6
0
	def test_zero_peer(self):
		""" Test that a zero peer list is decoded correctly. """

		self.p = torrent.decode_binary_peers([])
		self.assertEqual(self.p, [])