Repository: berkeley-reclab/RecLab (language: python)

Issue:
Fix the example provided in the README and add a corresponding test
The example provided in the README seems out of date.  


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index 091341ca..edb1db25 100644
--- a/README.md
+++ b/README.md
@@ -32,15 +32,28 @@ which will install both the core reclab framework and the benchmark recommendati
 ### Example
 The code below shows a simple use-case with random recommendations.
 ```python
-import numpy as np
-import reclab
-env = reclab.make('topics-dynamic-v1')
-items, users, ratings = env.reset()
-for _ in range(1000):
-    online_users = env.online_users()
-    # Your recommendation algorithm here. This recommends 10 random items to each online user.
-    recommendations = np.random.choice(items, size=(len(online_users), 10))
-    items, users, ratings, info = env.step(recommendations)
+n_users = 1000
+n_topics = 10
+n_items = 20
+env = reclab.make(
+    "topics-dynamic-v1",
+    num_topics=n_topics,
+    num_users=n_users,
+    num_items=n_items,
+    num_init_ratings=n_users * n_topics,
+)
+users, items, ratings = env.reset()
+assert len(users) == n_users
+assert len(items) == n_items
+for _ in range(1):
+    online_users = env.online_users
+    # Your recommendation algorithm here.
+    # This recommends 2 random items to each online user.
+    recommendations = np.random.choice(
+        len(items), size=(len(online_users), 2)
+    )
+    users, items, ratings, info = env.step(recommendations)
+
 env.close()
 ```
 


Test patch:
diff --git a/tests/test_simple_example.py b/tests/test_simple_example.py
new file mode 100644
index 00000000..1edf9537
--- /dev/null
+++ b/tests/test_simple_example.py
@@ -0,0 +1,34 @@
+"""
+Test the basic example found in the README
+"""
+import numpy as np
+import reclab
+
+
+def test_basic_example():
+    """
+    Test the basic example in the READMe
+    """
+    n_users = 1000
+    n_topics = 10
+    n_items = 20
+    env = reclab.make(
+        'topics-dynamic-v1',
+        num_topics=n_topics,
+        num_users=n_users,
+        num_items=n_items,
+        num_init_ratings=n_users * n_topics,
+    )
+    users, items, _ = env.reset()
+    assert len(users) == n_users
+    assert len(items) == n_items
+    for _ in range(1):
+        online_users = env.online_users
+        # Your recommendation algorithm here.
+        # This recommends 2 random items to each online user.
+        recommendations = np.random.choice(
+            len(items), size=(len(online_users), 2)
+        )
+        users, items, _, _ = env.step(recommendations)
+
+    env.close()