Esempio n. 1
0
    def setUp(self):
        self.consumer = OAuthConsumer(
            GenusApiTestCase.CONSUMER_KEY,
            GenusApiTestCase.CONSUMER_SECRET
        )

        self.genus_api = GenusApi(self.consumer, "2.0")
Esempio n. 2
0
class GenusApiTestCase(unittest.TestCase):
    """Test case to see if an api call can really be made
    """

    CONSUMER_KEY = 'x'
    CONSUMER_SECRET = 'x'

    def setUp(self):
        self.consumer = OAuthConsumer(
            GenusApiTestCase.CONSUMER_KEY,
            GenusApiTestCase.CONSUMER_SECRET
        )

        self.genus_api = GenusApi(self.consumer, "2.0")

    def test_do_method(self):
        """Make an API call to the server.
        """
        response = self.genus_api.do_method(
            "media.getPublic",
            {
                "sorttype":"mostrespect",
                'mediatype':'image',
                'timespan':'day'
            }
        )
        self.assertTrue(len(response) > 0)