I have a tap that I am using a google client libra...
# singer-tap-development
a
I have a tap that I am using a google client library for authentication. I create the client in the
discover_streams
method (in my
_custom_initialization
method), which works fine.
Copy code
def discover_streams(self) -> list[streams.GoogleSearchConsoleStream]:
        """Return a list of discovered streams.

        Returns:
            A list of discovered streams.
        """
        self._custom_initialization()
        return [
            streams.PerformanceReportPage(self, service=self.service),
            streams.PerformanceReportDate(self, service=self.service),
            streams.PerformanceReportCountry(self, service=self.service),
            streams.PerformanceReportQuery(self, service=self.service),
            streams.PerformanceReportDevice(self, service=self.service),
        ]
But when I am trying to develop some tests, this obviously causes an issue, as I don't have any test credentials. Is there an alternative method I can move this
_custom_initialization
in my
Tap
class so it run after
discover_streams
? Any perhaps any suggestions for how to handle 'fake' credentials for developing some unit tests?
v
That data you're hitting smells like Google ads data, there's a tap we wrote for that fyi But to your point I think you could mock the Auth requests using something like this setup https://github.com/AutoIDM/tap-clickup/blob/main/tap_clickup/tests/test_streams.py I don't normally take the time, but it's honestly worth it if you're doing something finicky
👍 1
With AI now it might just generate the stuff for you if you send it that example and your code as context, I hear tests work really well
a
I will check out those tests, thanks. TBH I am not super familiar with writing tests in the SDK framework
dancingpenguin 2