Add unit test for detach_subnets()