about summary refs log tree commit diff
path: root/test/python/test_groups.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/python/test_groups.py')
-rw-r--r--test/python/test_groups.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/python/test_groups.py b/test/python/test_groups.py
index a3dcb55..2cd09de 100644
--- a/test/python/test_groups.py
+++ b/test/python/test_groups.py
@@ -76,6 +76,28 @@ class GroupsTest(ServerTestCase):
         self.assertIn("HXBBXH", rat_reference)
         self.assertNotIn("BXD", rat_reference)
 
+    def test_groups_report_the_mapping_tool_offered_for_them(self):
+        if not database_reachable():
+            self.skipTest("no database on 127.0.0.1:3306")
+        token = auth_token()
+        if not token:
+            self.skipTest("no token (see docs/gn-auth.md)")
+
+        conn = http.client.HTTPConnection(HOST, int(PORT), timeout=10)
+        try:
+            conn.request("GET", "/groups", headers={"Authorization": f"Bearer {token}"})
+            response = conn.getresponse()
+            body = response.read()
+        finally:
+            conn.close()
+        self.assertEqual(response.status, 200)
+        tool = {g["name"]: g["mapping_method"] for g in envelope_data(body)}
+
+        self.assertEqual(tool["BXD"], "qtlreaper")
+        self.assertEqual(tool["HSNIH-Palmer"], "Rqtl")
+        self.assertEqual(tool["HSNIH-RGSMC"], "qtlreaper")  # not every outbred set uses Rqtl
+        self.assertIsNone(tool["Oregon-R_x_2b3"])
+
 
 if __name__ == "__main__":
     unittest.main()