def test_create_delete_asset(self):
        assets_helper.create(self.conn, asset_x)
        assets_helper.delete(self.conn, asset_x['asset_id'])

        assets_helper.create(self.conn, asset_y)
        assets_helper.delete(self.conn, asset_y['asset_id'])

        should_be_empty = assets_helper.read(self.conn)
        self.assertEmpty(should_be_empty)
Exemple #2
0
def remove_asset(asset_id):
    asset = assets_helper.read(db_conn, asset_id)
    try:
        if asset['uri'].startswith(settings['assetdir']):
            os.remove(asset['uri'])
    except OSError:
        pass
    assets_helper.delete(db_conn, asset_id)
    response.status = 204  # return an OK with no content
Exemple #3
0
def remove_asset(asset_id):
    asset = assets_helper.read(db_conn, asset_id)
    try:
        if asset['uri'].startswith(settings['assetdir']):
            os.remove(asset['uri'])
    except OSError:
        pass
    assets_helper.delete(db_conn, asset_id)
    response.status = 204  # return an OK with no content
Exemple #4
0
    def test_create_delete_asset(self):
        assets_helper.create(self.conn, asset_x)
        assets_helper.delete(self.conn, asset_x['asset_id'])

        assets_helper.create(self.conn, asset_y)
        assets_helper.delete(self.conn, asset_y['asset_id'])

        should_be_empty = assets_helper.read(self.conn)
        self.assertEmpty(should_be_empty)