Example #1
0
    def test_unique_identifier_version(self, mock_get):
        uid = '#!'
        mock_response = mock.Mock(ok=True, status_code=200)
        mock_get.return_value = mock_response
        mock_response.json.return_value = {
            'data': {
                'extra': {},
                'version': uid
            }
        }

        guid = BoxFile(node=self.project, path='1234567890/foo/bar')
        guid.enrich()
        assert_equals(uid, guid.unique_identifier)
Example #2
0
    def test_unique_identifier_version(self, mock_get):
        uid = '#!'
        mock_response = mock.Mock(ok=True, status_code=200)
        mock_get.return_value = mock_response
        mock_response.json.return_value = {
            'data': {
                'extra': {},
                'version': uid
            }
        }

        guid = BoxFile(node=self.project, path='1234567890/foo/bar')
        guid.enrich()
        assert_equals(uid, guid.unique_identifier)
Example #3
0
def main():
    with TokuTransaction():
        for file in BoxFile.find():
            new_path = '/' + file.path.split('/')[1]
            logger.info(u'{} -> {}'.format(file.path, new_path))
            file.path = new_path
            file.save()
Example #4
0
def main():
    with TokuTransaction():
        for file in BoxFile.find():
            new_path = '/' + file.path.split('/')[1]
            logger.info(u'{} -> {}'.format(file.path, new_path))
            file.path = new_path
            file.save()
Example #5
0
    def test_correct_path(self):
        guid = BoxFile(node=self.project, path='1234567890/foo/bar')

        assert_equals(guid.path, '1234567890/foo/bar')
        assert_equals(guid.waterbutler_path, '/1234567890/foo/bar')
Example #6
0
 def test_provider(self):
     assert_equal('box', BoxFile().provider)