diveintopython.pdf


Preview of PDF document diveintopython.pdf

Page 1 2 345327

Text preview


Table of Contents
Chapter 10. Scripts and Streams
10.6. Handling command−line arguments........................................................................................................143
10.7. Putting it all together................................................................................................................................146
10.8. Summary..................................................................................................................................................148
Chapter 11. HTTP Web Services................................................................................................................................149
11.1. Diving in..................................................................................................................................................149
11.2. How not to fetch data over HTTP............................................................................................................151
11.3. Features of HTTP.....................................................................................................................................152
11.4. Debugging HTTP web services...............................................................................................................153
11.5. Setting the User−Agent............................................................................................................................155
11.6. Handling Last−Modified and ETag.........................................................................................................156
11.7. Handling redirects....................................................................................................................................159
11.8. Handling compressed data.......................................................................................................................163
11.9. Putting it all together................................................................................................................................165
11.10. Summary................................................................................................................................................167
Chapter 12. SOAP Web Services................................................................................................................................168
12.1. Diving In..................................................................................................................................................168
12.2. Installing the SOAP Libraries..................................................................................................................169
12.3. First Steps with SOAP.............................................................................................................................171
12.4. Debugging SOAP Web Services.............................................................................................................172
12.5. Introducing WSDL...................................................................................................................................173
12.6. Introspecting SOAP Web Services with WSDL......................................................................................174
12.7. Searching Google.....................................................................................................................................176
12.8. Troubleshooting SOAP Web Services.....................................................................................................179
12.9. Summary..................................................................................................................................................182
Chapter 13. Unit Testing.............................................................................................................................................183
13.1. Introduction to Roman numerals.............................................................................................................183
13.2. Diving in..................................................................................................................................................184
13.3. Introducing romantest.py.........................................................................................................................184
13.4. Testing for success...................................................................................................................................187
13.5. Testing for failure....................................................................................................................................189
13.6. Testing for sanity.....................................................................................................................................190
Chapter 14. Test−First Programming........................................................................................................................193
14.1. roman.py, stage 1.....................................................................................................................................193
14.2. roman.py, stage 2.....................................................................................................................................196
14.3. roman.py, stage 3.....................................................................................................................................199
14.4. roman.py, stage 4.....................................................................................................................................202
14.5. roman.py, stage 5.....................................................................................................................................205
Chapter 15. Refactoring..............................................................................................................................................208
15.1. Handling bugs..........................................................................................................................................208
15.2. Handling changing requirements.............................................................................................................210
15.3. Refactoring...............................................................................................................................................216
15.4. Postscript..................................................................................................................................................219
15.5. Summary..................................................................................................................................................221

Dive Into Python

iii