-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
97 lines (82 loc) · 2.56 KB
/
test.py
File metadata and controls
97 lines (82 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import unittest
from unittest import TestCase
import li_traceroute.traceroute as t
import li_traceroute.udp_trace as udp
import li_traceroute.icmp_trace as icmp
import socket
from li_traceroute.try_data import TryData
class Test_makegraf(TestCase):
def test_justmake(self):
r_data = []
result = TryData()
result.add(0, 0.2)
result.add(1, 0.01)
result.add(2, 0.1)
result.addr = '111.111.111.111'
for i in range(15):
r_data.append((result))
t.get_graf(r_data)
def test_makemanyseconds(self):
r_data = []
result = TryData()
result.add(0, 3)
result.add(1, 0.01)
result.add(2, 3)
result.addr = '111.111.111.111'
for i in range(15):
r_data.append(result)
t.get_graf(r_data)
def test_makelowseconds(self):
r_data = []
result = TryData()
result.add(0, 0.003)
result.add(1, 0.01)
result.add(2, 0.000001)
result.addr = '111.111.111.111'
for i in range(15):
r_data.append(result)
t.get_graf(r_data)
def test_nodata(self):
r_data = []
t.get_graf(r_data)
def test_makesmany(self):
r_data = []
result = TryData()
result.add(0, 0.2)
result.add(1, 0.01)
result.add(2, 0.1)
result.addr = '111.111.111.111'
for i in range(255):
r_data.append((result))
t.get_graf(r_data)
def test_shortip(self):
r_data = []
result = TryData()
result.add(0, 0.2)
result.add(1, 0.01)
result.add(2, 0.1)
result.addr = '1.1.1.1'
for i in range(15):
r_data.append((result))
t.get_graf(r_data)
# class Test_Just(TestCase):
# def test_yandex30(self):
# addr = socket.gethostbyname('yandex.ru')
# udp.get_route(addr, 30, 33434)
# #def test_yandex1(self):
# #addr = socket.gethostbyname('yandex.ru')
# #udp.get_route(addr, 1, 33434)
# #def test_wikipedia(self):
# #addr = socket.gethostbyname('ru.wikipedia.org')
# #udp.get_route(addr, 30, 33434)
# #def test_i_yandex30(self):
# #addr = socket.gethostbyname('yandex.ru')
# #icmp.get_route(addr, 30, 33434)
# #def test_i_yandex1(self):
# #addr = socket.gethostbyname('yandex.ru')
# #icmp.get_route(addr, 1, 33434)
# #def test_i_wikipedia(self):
# #addr = socket.gethostbyname('ru.wikipedia.org')
# #icmp.get_route(addr, 30, 33434)
if __name__ == '__main__':
unittest.main()