コード例 #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)])
コード例 #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)])
コード例 #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, [])
コード例 #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)])
コード例 #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)])
コード例 #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, [])