about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
Diffstat (limited to 'test/python')
-rw-r--r--test/python/test_group_by_name.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/python/test_group_by_name.py b/test/python/test_group_by_name.py
index 440ee8b..cc8e39b 100644
--- a/test/python/test_group_by_name.py
+++ b/test/python/test_group_by_name.py
@@ -35,9 +35,29 @@ class GroupByNameTest(ServerTestCase):
 
         group = json.loads(body)
         self.assertEqual(group["name"], "BXD")
-        self.assertEqual(group["inbred_set_name"], "BXD")
+        self.assertEqual(group["display_name"], "BXD")
         self.assertEqual(group["genetic_type"], "riset")
 
+    def test_group_by_name_numeric_id_returns_same_group_row(self):
+        """BXD's InbredSet.Id is 1, same as its InbredSetId; replicates
+        gn-guile's gn.data.population:population-info, which looks a
+        group up by numeric Id rather than by name."""
+        if not database_reachable():
+            self.skipTest("no database on 127.0.0.1:3306")
+
+        conn = http.client.HTTPConnection(HOST, int(PORT), timeout=10)
+        try:
+            conn.request("GET", "/groups/1")
+            response = conn.getresponse()
+            body = response.read()
+        finally:
+            conn.close()
+        self.assertEqual(response.status, 200)
+
+        group = json.loads(body)
+        self.assertEqual(group["name"], "BXD")
+        self.assertEqual(group["id"], 1)
+
     def test_group_by_name_unknown_group_returns_404(self):
         if not database_reachable():
             self.skipTest("no database on 127.0.0.1:3306")