Commit graph

53 commits

Author SHA1 Message Date
Yuxin Wang
e4567c45a7 Fix test code. 2018-10-11 23:06:37 -04:00
Yuxin Wang
d2c4543fbb Add test for tracker disconnect. 2018-10-11 18:08:39 -04:00
Yuxin Wang
8e5d81cea5 Add more tests for test_tracker_restart. 2018-10-10 21:02:52 -04:00
Yuxin Wang
a3b72c41a2 Add test for running status. 2018-10-10 20:34:52 -04:00
Yuxin Wang
81c58c540b Add simple test_tracker_restart. 2018-10-10 20:32:45 -04:00
Yuxin Wang
3b682471b8 Remove test_tracker_restart temporarily. 2018-10-10 20:31:49 -04:00
Yuxin Wang
ea0d9c1ce7 Move setup_tracker_and_peers to conftest. 2018-10-10 20:28:54 -04:00
Yuxin Wang
526ac4c083 Fix usage of start. 2018-10-10 19:38:22 -04:00
Yuxin Wang
7125636e46 Refactor initialization.
Adopt lazy initializations, Peer class now has connect method to connect to tracker.
2018-10-10 19:34:52 -04:00
Yuxin Wang
5366d543f2 Add test for download_disconnect. 2018-10-10 16:42:41 -04:00
Yuxin Wang
a74e7bc6be Put stop tracker and peer into finally block. 2018-10-10 00:05:24 -04:00
Yuxin Wang
f5c6d1dbe3 Remove downloaded files after test. 2018-10-09 23:54:36 -04:00
Yuxin Wang
eff9a968a5 Put remove file to the finally block. 2018-10-09 23:53:21 -04:00
Yuxin Wang
fc7fe1c59c Add TEST_SMALL_FILE_1 for test_delay(). 2018-10-09 23:53:03 -04:00
Yuxin Wang
35d95ab5e1 Rename the variable for better readability. 2018-10-09 16:53:47 -04:00
Yuxin Wang
792ff2df67 Move tests for result in try block. 2018-10-09 16:50:23 -04:00
Yuxin Wang
33c44e12b5 Add concurrent download tests. 2018-10-09 16:50:09 -04:00
Yuxin Wang
872615f529 Put remove file in finally block. 2018-10-09 16:37:44 -04:00
Yuxin Wang
9e98cc3d31 Close the writer if the writer hasn't been closed. 2018-10-09 14:34:19 -04:00
Yuxin Wang
c8c58f4c92 Wait longer for tracker code to run. 2018-10-09 01:27:48 -04:00
Yuxin Wang
e01c0ffee1 Add artificial delay for peer. 2018-10-09 01:27:01 -04:00
Yuxin Wang
7f62307a3a Cleanup peers information when disconnected. 2018-10-09 00:26:42 -04:00
Yuxin Wang
322fa8b6cb Add todos. 2018-10-08 23:45:25 -04:00
Yuxin Wang
29153c45a6 Spawn 2 peers instead of 3. 2018-10-08 22:55:19 -04:00
Yuxin Wang
c1b86e4779 Remove unnecessary code. 2018-10-08 21:36:35 -04:00
Yuxin Wang
527c1f2443 Use pytest-asyncio to run test asynchrounouly.
Isolate each test_ functions.
2018-10-08 21:29:51 -04:00
Yuxin Wang
0753e266d6 Fix typo. 2018-10-08 19:02:31 -04:00
Yuxin Wang
bb8fccd696 Add some tests for terminal. 2018-10-08 17:00:19 -04:00
Yuxin Wang
451d43e3bf Add test for publish_refusal. 2018-10-08 14:10:39 -04:00
Yuxin Wang
04f6c67afe Fix typo. 2018-10-08 14:09:52 -04:00
Yuxin Wang
f9eccc6c99 Assert on the result of publish. 2018-10-08 14:09:11 -04:00
Yuxin Wang
0c0969f603 Use pre-defined file sizes to do assert. 2018-10-08 14:08:30 -04:00
Yuxin Wang
554a8e5ac3 Fix name mismatch. 2018-10-08 14:02:32 -04:00
Yuxin Wang
79d4e3b399 Rename test_main to test_core. 2018-10-08 14:00:59 -04:00
Yuxin Wang
1df02a4936 Split the test into multiple functions. 2018-10-08 14:00:45 -04:00
Yuxin Wang
8b1f4c6b7c Add conftest to create and delete test files on session level. 2018-10-08 13:51:02 -04:00
Yuxin Wang
ae6330cafa Unpack the list to arguments. 2018-10-08 10:41:25 -04:00
Yuxin Wang
ea33442949 asyncio.gather needs ordered data structure. 2018-10-08 10:34:39 -04:00
Yuxin Wang
e1f38dcd76 Add test for downloading from multiple peers. 2018-10-07 23:27:22 -04:00
Yuxin Wang
0651c43da3 Use tuple to represent multiple peers. 2018-10-07 23:19:37 -04:00
Yuxin Wang
dc6c44c7e3 Change import order to comply with PEP. 2018-10-07 12:23:27 -04:00
Yuxin Wang
c0fba12bdc Run peer and tracker stop asynchronously. 2018-10-07 12:07:18 -04:00
Yuxin Wang
8db58b4441 Make the tests asynchronous. 2018-10-06 14:18:23 -04:00
Yuxin Wang
2d71e1581d Refactor test_server_refused with asyncio. 2018-10-06 11:01:03 -04:00
Yuxin Wang
13ba10c595 Add test for reporthook. 2018-10-04 00:01:22 -04:00
Yuxin Wang
854d1676bb Return boolean value for start method. 2018-10-01 22:30:46 -04:00
Yuxin Wang
488987a326 Return True/False for start method. 2018-10-01 21:47:53 -04:00
Yuxin Wang
2450554ffb Start server after test files are created. 2018-10-01 15:17:53 -04:00
Yuxin Wang
54bc2c901a Replace exit with stop. 2018-09-30 14:22:55 -04:00
Yuxin Wang
b777ebb616 Fix peer name. 2018-09-30 13:49:24 -04:00