Add unittest for discrete functions in the apt module