Deleted
Added
test_go_application.py (1165:998b521bbdb8) | test_go_application.py (1453:71af60a59338) |
---|---|
1from unit.applications.lang.go import TestApplicationGo 2 3 4class TestGoApplication(TestApplicationGo): 5 prerequisites = {'modules': ['go']} 6 7 def test_go_application_variables(self): 8 self.load('variables') --- 75 unchanged lines hidden (view full) --- 84 resp['body'], r'<title>404 Not Found</title>', '404 body' 85 ) 86 87 def test_go_keepalive_body(self): 88 self.load('mirror') 89 90 self.assertEqual(self.get()['status'], 200, 'init') 91 | 1from unit.applications.lang.go import TestApplicationGo 2 3 4class TestGoApplication(TestApplicationGo): 5 prerequisites = {'modules': ['go']} 6 7 def test_go_application_variables(self): 8 self.load('variables') --- 75 unchanged lines hidden (view full) --- 84 resp['body'], r'<title>404 Not Found</title>', '404 body' 85 ) 86 87 def test_go_keepalive_body(self): 88 self.load('mirror') 89 90 self.assertEqual(self.get()['status'], 200, 'init') 91 |
92 body = '0123456789' * 500 |
|
92 (resp, sock) = self.post( 93 headers={ 94 'Host': 'localhost', 95 'Connection': 'keep-alive', 96 'Content-Type': 'text/html', 97 }, 98 start=True, | 93 (resp, sock) = self.post( 94 headers={ 95 'Host': 'localhost', 96 'Connection': 'keep-alive', 97 'Content-Type': 'text/html', 98 }, 99 start=True, |
99 body='0123456789' * 500, | 100 body=body, |
100 read_timeout=1, 101 ) 102 | 101 read_timeout=1, 102 ) 103 |
103 self.assertEqual(resp['body'], '0123456789' * 500, 'keep-alive 1') | 104 self.assertEqual(resp['body'], body, 'keep-alive 1') |
104 | 105 |
106 body = '0123456789' |
|
105 resp = self.post( 106 headers={ 107 'Host': 'localhost', 108 'Content-Type': 'text/html', 109 'Connection': 'close', 110 }, 111 sock=sock, | 107 resp = self.post( 108 headers={ 109 'Host': 'localhost', 110 'Content-Type': 'text/html', 111 'Connection': 'close', 112 }, 113 sock=sock, |
112 body='0123456789', | 114 body=body, |
113 ) 114 | 115 ) 116 |
115 self.assertEqual(resp['body'], '0123456789', 'keep-alive 2') | 117 self.assertEqual(resp['body'], body, 'keep-alive 2') |
116 117 def test_go_application_cookies(self): 118 self.load('cookies') 119 120 resp = self.get( 121 headers={ 122 'Host': 'localhost', 123 'Cookie': 'var1=val1; var2=val2', --- 65 unchanged lines hidden --- | 118 119 def test_go_application_cookies(self): 120 self.load('cookies') 121 122 resp = self.get( 123 headers={ 124 'Host': 'localhost', 125 'Cookie': 'var1=val1; var2=val2', --- 65 unchanged lines hidden --- |