Ejemplo n.º 1
0
 def test_get_categories_response_error(self, playstore, monkeypatch):
     # Simulate a bad response from the server.
     monkeypatch.setattr(
         Playstore,
         "_execute_request",
         lambda self, path, query: playstore_protobuf.DocV2(),
     )
     categories = playstore.get_store_categories()
     assert categories is None
Ejemplo n.º 2
0
 def test_search_response_error(self, playstore, monkeypatch):
     # Simulate a bad response from the server.
     monkeypatch.setattr(
         Playstore,
         "_execute_request",
         lambda self, path, query: playstore_protobuf.DocV2(),
     )
     results = playstore.search("music")
     assert results is None
Ejemplo n.º 3
0
 def test_list_app_by_category_response_error(self, playstore, monkeypatch):
     # Simulate a bad response from the server.
     monkeypatch.setattr(
         Playstore,
         "_execute_request",
         lambda self, path, query: playstore_protobuf.DocV2(),
     )
     subcategories = playstore.list_app_by_category("PRODUCTIVITY")
     assert subcategories is None
Ejemplo n.º 4
0
 def test_app_details_response_error(self, playstore, monkeypatch):
     # Simulate a bad response from the server.
     meta = PackageMeta(playstore, VALID_PACKAGE_NAME)
     monkeypatch.setattr(
         Playstore,
         "_execute_request",
         lambda self, path, query: playstore_protobuf.DocV2(),
     )
     with pytest.raises(AttributeError):
         meta.app_details()
Ejemplo n.º 5
0
 def mock(*args, **kwargs):
     if mock.counter < 1:
         mock.counter += 1
         return original(*args, **kwargs)
     else:
         return playstore_protobuf.DocV2()