@@ -46,7 +46,7 @@ def test_get_arabidopsis_gene_publications(self):
4646 :return:
4747 """
4848 # Valid data
49- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020" )
49+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020" )
5050 expected = {
5151 "wasSuccessful" : True ,
5252 "data" : [
@@ -70,7 +70,7 @@ def test_get_arabidopsis_gene_publications(self):
7070 }
7171 self .assertEqual (response .json , expected )
7272
73- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020." )
73+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020." )
7474 expected = {
7575 "wasSuccessful" : True ,
7676 "data" : [
@@ -94,7 +94,7 @@ def test_get_arabidopsis_gene_publications(self):
9494 }
9595 self .assertEqual (response .json , expected )
9696
97- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.0" )
97+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.0" )
9898 expected = {
9999 "wasSuccessful" : True ,
100100 "data" : [
@@ -118,7 +118,7 @@ def test_get_arabidopsis_gene_publications(self):
118118 }
119119 self .assertEqual (response .json , expected )
120120
121- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.1" )
121+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.1" )
122122 expected = {
123123 "wasSuccessful" : True ,
124124 "data" : [
@@ -142,7 +142,7 @@ def test_get_arabidopsis_gene_publications(self):
142142 }
143143 self .assertEqual (response .json , expected )
144144
145- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.12345" )
145+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.12345" )
146146 expected = {
147147 "wasSuccessful" : True ,
148148 "data" : [
@@ -167,25 +167,30 @@ def test_get_arabidopsis_gene_publications(self):
167167 self .assertEqual (response .json , expected )
168168
169169 # Data not found, but gene is valid
170- response = self .app_client .get ("/gene_information/gene_publications/AT1G01035" )
170+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01035" )
171171 expected = {
172172 "wasSuccessful" : False ,
173173 "error" : "There are no data found for the given gene" ,
174174 }
175175 self .assertEqual (response .json , expected )
176176
177- response = self .app_client .get ("/gene_information/gene_publications/AT1G010400" )
177+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G010400" )
178178 expected = {
179179 "wasSuccessful" : False ,
180180 "error" : "There are no data found for the given gene" ,
181181 }
182182 self .assertEqual (response .json , expected )
183183
184184 # Invalid Gene
185- response = self .app_client .get ("/gene_information/gene_publications/001G01030" )
185+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ 001G01030" )
186186 expected = {"wasSuccessful" : False , "error" : "Invalid gene id" }
187187 self .assertEqual (response .json , expected )
188188
189+ # Invalid Species
190+ response = self .app_client .get ("/gene_information/gene_publications/x/AT1G01020" )
191+ expected = {"wasSuccessful" : False , "error" : "No data for the given species" }
192+ self .assertEqual (response .json , expected )
193+
189194 def test_get_arabidopsis_gene_isoform (self ):
190195 """This tests checks GET request for gene isoforms Arabidopsis
191196 :return:
0 commit comments