Repository: oceanprotocol/ocean.py (language: python)

Issue:
Ensure simple-remote README is tested in CI
#933 was recently merged (https://github.com/oceanprotocol/ocean.py/commit/60e137d6568e7075a7d615a435ff8bfaa567f972). But it is not currently part of the CI testing of READMEs. The aim of this issue is to get remote tests.

How: [from Calina in #933's PR comments](https://github.com/oceanprotocol/ocean.py/pull/934#pullrequestreview-1111810049):
> can we add a sample here for CI purposes, if possible? I know it would be a duplicate and a DRY violation, but it would help with automated testing. Alternately let's have remote-based tests. We should explore that option as well: a remote-based test suite running periodically, like we run our lib viability/compatibility test.



Discussion / hints:

Fix patch:
diff --git a/READMEs/simple-remote.md b/READMEs/simple-remote.md
index 7d7761a54..64f728fd8 100644
--- a/READMEs/simple-remote.md
+++ b/READMEs/simple-remote.md
@@ -46,15 +46,19 @@ python
 In the Python console:
 ```python
 # Create Ocean instance
+from ocean_lib.web3_internal.utils import connect_to_network
+connect_to_network("mumbai")
+
 import os
 from ocean_lib.example_config import ExampleConfig
 from ocean_lib.ocean.ocean import Ocean
 config = ExampleConfig.get_config("mumbai")
 ocean = Ocean(config)
 
-# Create Alice's wallet
-import os
 from brownie.network import accounts
+accounts.clear()
+
+# Create Alice's wallet
 
 alice_private_key = os.getenv('REMOTE_TEST_PRIVATE_KEY1')
 alice_wallet = accounts.add(alice_private_key)


Test patch:
diff --git a/tests/readmes/test_readmes.py b/tests/readmes/test_readmes.py
index 6c96a0b21..7d38853ac 100644
--- a/tests/readmes/test_readmes.py
+++ b/tests/readmes/test_readmes.py
@@ -92,3 +92,17 @@ def test_script_execution(script, monkeypatch):
                 globs[key] = result[key]
 
     runpy.run_path(str(script), run_name="__main__", init_globals=globs)
+
+
+def test_simple_remote(monkeypatch):
+    script = pathlib.Path(
+        __file__, "..", "..", "generated-readmes", "test_simple-remote.py"
+    )
+    result = runpy.run_path(str(script), run_name="__main__")
+    ocean, alice_wallet = result["ocean"], result["alice_wallet"]
+    data_nft = ocean.create_data_nft("NFT1", "NFT1", alice_wallet)
+    assert data_nft
+    datatoken = data_nft.create_datatoken(
+        "Datatoken 1", "DT1", from_wallet=alice_wallet
+    )
+    assert datatoken