Tests should be designed to be independent and avoid coupling to implementation details. Use public interfaces rather than accessing internal state, prefer mocked or fake data over external dependencies, and keep tests general rather than tightly coupled to specific implementations.
Key principles:
raw_points
in test cases - use proper public interfaces like handle_log
insteadExample of good practice:
# Instead of accessing internal state:
est.raw_points["lat_active"].append(True)
# Use the public interface:
est.handle_log(log_message)
This approach makes tests more maintainable, less brittle to refactoring, and easier to understand by focusing on the component’s public contract rather than its internal implementation.
Enter the URL of a public GitHub repository