i understand why you may want to mock objects for rules and policies  i do not follow though why you pass those mocks into create policy here since it is only passed thru to registry m  that is also mocked  i believe you should create a separate mock in the test case to represent a policy object  even better  you would instantiate a real object and pass it into driver create policy  same for all other tests that call to self driver directly  overall  for those self driver tests  you do not really need to mock out policy and rule object implementations at all  you would need those mocks for tests that target qos plugin py  but they should be moved into a separate file anyway  so consider avoiding unneeded mocks for this and other self driver tests 