@@ -48,7 +48,7 @@ def test_get_arabidopsis_gene_publications(self):
4848 :return:
4949 """
5050 # Valid data
51- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020" )
51+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020" )
5252 expected = {
5353 "wasSuccessful" : True ,
5454 "data" : [
@@ -72,7 +72,7 @@ def test_get_arabidopsis_gene_publications(self):
7272 }
7373 self .assertEqual (response .json , expected )
7474
75- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020." )
75+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020." )
7676 expected = {
7777 "wasSuccessful" : True ,
7878 "data" : [
@@ -96,7 +96,7 @@ def test_get_arabidopsis_gene_publications(self):
9696 }
9797 self .assertEqual (response .json , expected )
9898
99- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.0" )
99+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.0" )
100100 expected = {
101101 "wasSuccessful" : True ,
102102 "data" : [
@@ -120,7 +120,7 @@ def test_get_arabidopsis_gene_publications(self):
120120 }
121121 self .assertEqual (response .json , expected )
122122
123- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.1" )
123+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.1" )
124124 expected = {
125125 "wasSuccessful" : True ,
126126 "data" : [
@@ -144,7 +144,7 @@ def test_get_arabidopsis_gene_publications(self):
144144 }
145145 self .assertEqual (response .json , expected )
146146
147- response = self .app_client .get ("/gene_information/gene_publications/AT1G01020.12345" )
147+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01020.12345" )
148148 expected = {
149149 "wasSuccessful" : True ,
150150 "data" : [
@@ -169,25 +169,30 @@ def test_get_arabidopsis_gene_publications(self):
169169 self .assertEqual (response .json , expected )
170170
171171 # Data not found, but gene is valid
172- response = self .app_client .get ("/gene_information/gene_publications/AT1G01035" )
172+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G01035" )
173173 expected = {
174174 "wasSuccessful" : False ,
175175 "error" : "There are no data found for the given gene" ,
176176 }
177177 self .assertEqual (response .json , expected )
178178
179- response = self .app_client .get ("/gene_information/gene_publications/AT1G010400" )
179+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ AT1G010400" )
180180 expected = {
181181 "wasSuccessful" : False ,
182182 "error" : "There are no data found for the given gene" ,
183183 }
184184 self .assertEqual (response .json , expected )
185185
186186 # Invalid Gene
187- response = self .app_client .get ("/gene_information/gene_publications/001G01030" )
187+ response = self .app_client .get ("/gene_information/gene_publications/arabidopsis/ 001G01030" )
188188 expected = {"wasSuccessful" : False , "error" : "Invalid gene id" }
189189 self .assertEqual (response .json , expected )
190190
191+ # Invalid Species
192+ response = self .app_client .get ("/gene_information/gene_publications/x/AT1G01020" )
193+ expected = {"wasSuccessful" : False , "error" : "No data for the given species" }
194+ self .assertEqual (response .json , expected )
195+
191196 def test_get_arabidopsis_gene_isoform (self ):
192197 """This tests checks GET request for gene isoforms Arabidopsis
193198 :return:
0 commit comments