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)
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()
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')
def test_provider(self): assert_equal('box', BoxFile().provider)