If you're playing on SP with Admin commands, go to the U (Blueprints menu) tab, click Admin tab, then find "Mass Spawn Ships". Use Faction ID -1 for pirates, spawn some harmless ship or block of stuff and see if your turrets shoot it.
Also, make sure you activate the AI when you exit the turret. If it's on a ship or station, get into a core or build block and open Inventory or Blueprint Menu, go to the top bar, find "Ship" ("Station" if applicable), drop it down, find "Entity Structure", search through the list, find "Turret Docking Collective", open that, press "Activate All AI Turrets" and then have fun.