def test_show_items_no_internet(self):
     wf._items = []
     Passwords.clear()
     Drive.clear_cache()
     wf.cache_data('drive_error', 'ConnectionError')
     httpretty.register_uri(httpretty.GET, FILES_URL, body=exceptionCallback, content_type='text/html');
     self.assertEquals(len(wf._items), 0)
     Drive.show_items('c')
     self.assertEquals(len(wf._items), 1)
     self.assertEquals(wf._items[0].title, ERRORS['ConnectionError']['title'])
 def test_show_items_no_access_token(self):
     wf._items = []
     Drive.clear_cache()
     Passwords.clear()
     httpretty.register_uri(httpretty.GET, FILES_URL, body=json.dumps({
         'items': SAMPLE_ITEMS
         }), content_type='application/json');
     self.assertEquals(len(wf._items), 0)
     Drive.show_items('c')
     self.assertEquals(len(wf._items), 1)
     self.assertEquals(wf._items[0].title, ERRORS['PasswordNotFound']['title'])
 def stest_get_links(self):
     wf._items = []
     Drive.clear_cache()
     with self.assertRaises(Exception):
         Drive.get_links()