Example #1
0
 def test_get_length(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_length(), 1150844928)
     self.assertEqual(test_data.get_length(), test_data.length)
     self.assertEqual(test_data.length, test_data.left)
Example #2
0
 def test_get_length(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_length(), 1150844928)
     self.assertEqual(test_data.get_length(), test_data.length)
     self.assertEqual(test_data.length, test_data.left)
Example #3
0
 def test_trackers(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(
         test_data.get_trackers(),
         [["http://torrent.ubuntu.com:6969/announce"], ["http://ipv6.torrent.ubuntu.com:6969/announce"]],
     )
     self.assertEqual(test_data.get_trackers(), test_data.trackers)
Example #4
0
 def test_creation_date(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_creation_date(), test_data.creation_date)
Example #5
0
 def test_info_hash(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_info_hash(), 'fc8a15a2faf2734dbb1dc5f7afdc5c9beaeb1f59')
     self.assertEqual(test_data.get_info_hash(), test_data.info_hash)
Example #6
0
 def test_info_hash_hex(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.info_hash_hex), 20)
Example #7
0
 def test_reserved(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.RESERVED), 8)
Example #8
0
 def test_id(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.ID), 2)
Example #9
0
 def test_version(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.VERSION), 4)
Example #10
0
 def test_id(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.ID), 2)
Example #11
0
 def test_peer_id(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(20, len(test_data.gen_peer_id()))
Example #12
0
 def test_ip(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(ipgetter.myip(), test_data.IP)
Example #13
0
 def test_creation_date(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_creation_date(), test_data.creation_date)
Example #14
0
 def test_info_hash(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_info_hash(), "fc8a15a2faf2734dbb1dc5f7afdc5c9beaeb1f59")
     self.assertEqual(test_data.get_info_hash(), test_data.info_hash)
Example #15
0
 def test_ip(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(ipgetter.myip(), test_data.IP)
Example #16
0
 def test_reserved(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.RESERVED), 8)
Example #17
0
 def test_peer_id(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(20, len(test_data.gen_peer_id()))
Example #18
0
 def test_protocol(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.PROTOCOL, "BitTorrent protocol")
Example #19
0
 def test_version(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.VERSION), 4)
Example #20
0
 def test_info_hash(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.info_hash), 40)
Example #21
0
 def test_protocol(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.PROTOCOL, "BitTorrent protocol")
Example #22
0
 def test_trackers(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(test_data.get_trackers(),[['http://torrent.ubuntu.com:6969/announce'], ['http://ipv6.torrent.ubuntu.com:6969/announce']])
     self.assertEqual(test_data.get_trackers(), test_data.trackers)
Example #23
0
 def test_handshake(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.handshake), 69)
Example #24
0
 def test_handshake(self):
     test_file = get_test_file()
     self.test_file = test_file.test_file
     test_data = data.get_data(self.test_file)
     self.assertEqual(len(test_data.handshake), 69)