Ejemplo n.º 1
0
    def test_single_peer(self):
        """ Test that a one peer list is decoded. """

        self.p = torrent.decode_expanded_peers( \
         [{'ip': '100.100.100.100', 'peer id': 'test1', \
          'port': 1000}])
        self.assertEqual(self.p, [("100.100.100.100", 1000)])
Ejemplo n.º 2
0
	def test_single_peer(self):
		""" Test that a one peer list is decoded. """

		self.p = torrent.decode_expanded_peers( \
			[{'ip': '100.100.100.100', 'peer id': 'test1', \
				'port': 1000}])
		self.assertEqual(self.p, [("100.100.100.100", 1000)])
Ejemplo n.º 3
0
    def test_multiple_peers(self):
        """ Test that a two peer list is decoded correctly. """

        self.p = torrent.decode_expanded_peers( \
         [{'ip': '100.100.100.100', \
         'peer id': 'test1', 'port': 1000}, \
          {'ip': '100.100.100.100', \
           'peer id': 'test2', 'port': 1000}])
        self.assertEqual(self.p, [('100.100.100.100', 1000), \
         ('100.100.100.100', 1000)])
Ejemplo n.º 4
0
	def test_multiple_peers(self):
		""" Test that a two peer list is decoded correctly. """

		self.p = torrent.decode_expanded_peers( \
			[{'ip': '100.100.100.100', \
			'peer id': 'test1', 'port': 1000}, \
				{'ip': '100.100.100.100', \
					'peer id': 'test2', 'port': 1000}])
		self.assertEqual(self.p, [('100.100.100.100', 1000), \
			('100.100.100.100', 1000)])
Ejemplo n.º 5
0
    def test_zero_peer(self):
        """ Test that a zero peer list is decoded correctly. """

        self.p = torrent.decode_expanded_peers([])
        self.assertEqual(self.p, [])
Ejemplo n.º 6
0
	def test_zero_peer(self):
		""" Test that a zero peer list is decoded correctly. """

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