- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Share form change #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
53371aa    to
    ce4c7ef      
    Compare
  
            
          
                cs3api4lab/api/cs3_ocm_share_api.py
              
                Outdated
          
        
      | elif stat_response.status.code == cs3_code.CODE_NOT_FOUND: | ||
| raise ResourceNotFoundError("Resource not found") | ||
| else: | ||
| self._handle_error(stat_response) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line
        
          
                cs3api4lab/api/cs3_user_api.py
              
                Outdated
          
        
      | 
               | 
          ||
| def get_user(self, idp, opaque_id): | ||
| user_info = self.get_user_info(idp, opaque_id) | ||
| if not bool(user_info) and self.config['enable_ocm']: | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for explicit conversion to bool
| 
               | 
          ||
| file_path = FileUtils.remove_drives_names(file_path) | ||
| file_path = ShareUtils.purify_file_path(file_path, self.config.client_id) | ||
| shares = [] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be
shares = [ShareUtils.get_share_info(share) for share in all_shares_list]
| 
               | 
          ||
| @skip | ||
| class TestCs3OcmShareApi(TestCase): | ||
| class TestCs3ShareApi(TestCase): | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the name change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't, I've changed it back
| from unittest import TestCase | ||
| from cs3api4lab.exception.exceptions import ShareError, ResourceNotFoundError | ||
| 
               | 
          ||
| from cs3api4lab.exception.exceptions import * | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wildcard imports should be avoided, instead:
from cs3api4lab.exception.exceptions import ShareError, ResourceNotFoundError, ShareNotFoundError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| """ | ||
| This tests checks if share_api.get() single share raises an exception when incorrect id is given | ||
| """ | ||
| random_id = self.get_random_suffix() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just be some made up id, doesn't have to be random
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| """This test if share_api.remove raises an error when share doesn't exist""" | ||
| 
               | 
          ||
| with self.assertRaises(Exception) as context: | ||
| self.share_api.remove(self.get_random_suffix()) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| """ | ||
| 
               | 
          ||
| try: | ||
| self.file_name = self.file_path + self.get_random_suffix() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
b93678a    to
    133ad93      
    Compare
  
    133ad93    to
    6115852      
    Compare
  
    646b2d2    to
    0a4d007      
    Compare
  
    77518b8    to
    52edf23      
    Compare
  
    52edf23    to
    0238d9b      
    Compare
  
    
No description provided.