about summary refs log tree commit diff
path: root/tests/integration/test_general.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-02-14 06:56:32 +0300
committerFrederick Muriuki Muriithi2022-02-17 06:37:30 +0300
commit74044f3c7985308b4996da3a52f91c5c20a19194 (patch)
treed86714b859b31cbbd1755522f8abd8eed16e321b /tests/integration/test_general.py
parent67f517aa0f44f55dc691ffd791bf22ef7af0b02c (diff)
downloadgenenetwork3-74044f3c7985308b4996da3a52f91c5c20a19194.tar.gz
Use pytest's "mark" feature to categorise tests
Use pytest's `mark` feature to explicitly categorise the tests and run them
per category
Diffstat (limited to 'tests/integration/test_general.py')
-rw-r--r--tests/integration/test_general.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/integration/test_general.py b/tests/integration/test_general.py
index 8fc2b43..9d87449 100644
--- a/tests/integration/test_general.py
+++ b/tests/integration/test_general.py
@@ -1,8 +1,10 @@
 """Integration tests for some 'general' API endpoints"""
 import os
 import unittest
-
 from unittest import mock
+
+import pytest
+
 from gn3.app import create_app
 
 
@@ -11,6 +13,7 @@ class GeneralAPITest(unittest.TestCase):
     def setUp(self):
         self.app = create_app().test_client()
 
+    @pytest.mark.integration_test
     def test_metadata_endpoint_exists(self):
         """Test that /metadata/upload exists"""
         response = self.app.post("/api/metadata/upload/d41d86-e4ceEo")
@@ -19,6 +22,7 @@ class GeneralAPITest(unittest.TestCase):
                          {"status": 128,
                           "error": "Please provide a file!"})
 
+    @pytest.mark.integration_test
     @mock.patch("gn3.api.general.extract_uploaded_file")
     def test_metadata_file_upload(self, mock_extract_upload):
         """Test correct upload of file"""
@@ -37,6 +41,7 @@ class GeneralAPITest(unittest.TestCase):
                          {"status": 0,
                           "token": "d41d86-e4ceEo"})
 
+    @pytest.mark.integration_test
     def test_metadata_file_wrong_upload(self):
         """Test that incorrect upload return correct status code"""
         response = self.app.post("/api/metadata/upload/d41d86-e4ceEo",
@@ -47,6 +52,7 @@ class GeneralAPITest(unittest.TestCase):
                          {"status": 128,
                           "error": "gzip failed to unpack file"})
 
+    @pytest.mark.integration_test
     @mock.patch("gn3.api.general.run_cmd")
     def test_run_r_qtl(self, mock_run_cmd):
         """Test correct upload of file"""