The more python I write the more curious I am about situations like this. My inclination is usually to introduce dependency injection and pass in the created A and B classes on the constructor. This makes it easy to both see the external dependencies and change them up when i need. But sometimes that is overkill. Could you not just:
server = Server()
server.a = MockA()
server.b = MockB()