BenMatteson / CS410_Agile_Group2

CS410 Agile Practice Project - FTP Client
0 stars 2 forks source link

Add rm command and unittests to remove remote file #42

Closed brialee closed 5 years ago

brialee commented 5 years ago

Adds the rm command to remove a remote file based on the file name given, which may or may not include a path.

ppdom commented 5 years ago

The unit test test_rm_file_nonexistent failed for me:

Traceback (most recent call last): File "FTP_tests.py", line 240, in test_rm_file_nonexistent self.assertNotIn(dir_files, filepath) File "/usr/lib/python3.6/unittest/case.py", line 1093, in assertNotIn if member in container: TypeError: 'in ' requires string as left operand, not list

I manually tested rm on ada.cs.pdx.edu and it seems to work. I noticed when I tried to delete a directory with rm the client crashed back to my shell after raising an IOError and OSError, however. I think if you check that the argument is a file using pysftyp's isfile method and raise an error if it fails the check would solve that issue.

brialee commented 5 years ago

The latest commit should resolve the issues in the FTP_tests.py file. Good thinking on the 'isfile' check to prevent the script from crashing. That's also updated in the latest commit.

brialee commented 5 years ago

The latest commits should resolve the issues in the FTP_tests.py file