lundi 7 décembre 2015

How to test parsed from the web data?

I have a program which captures some data from the Internet and performors some actions on it. Very basic code:

class ParsedData:

    data = None

    def _get(self):
        self.data = requests.get('...')

    def method1(self):
        self._get()

    def method2(self):
        self._get()

How do I need to test method1 and method2? Do I need to provide my own web-like data in the TestCase and not get it from the web at all, or I can just test it with real data from the web and check weather the results of the program are correct?

Aucun commentaire:

Enregistrer un commentaire