Example #1
0
    def test_successfully(self):
        '''Tests calling NfsBroker.setup_upload_dir() successfully'''

        mount = 'host:/dir'
        upload_dir = os.path.join('the', 'upload', 'dir')
        work_dir = os.path.join('the', 'work', 'dir')

        # Call method to test
        broker = NfsBroker()
        broker.load_config({'type': NfsBroker.broker_type, 'mount': mount})
        broker.setup_upload_dir(upload_dir, work_dir)
Example #2
0
    def test_successfully(self, mock_mkdir):
        '''Tests calling NfsBroker.setup_upload_dir() successfully'''

        mount = 'host:/dir'
        upload_dir = os.path.join('the', 'upload', 'dir')
        work_dir = os.path.join('the', 'work', 'dir')

        # Call method to test
        broker = NfsBroker()
        broker.load_config({'type': NfsBroker.broker_type, 'mount': mount})
        broker.setup_upload_dir(upload_dir, work_dir)

        # Check results
        mock_mkdir.assert_called_once_with(upload_dir, 0755)