@@ -52,6 +52,30 @@ def test_bands(self):
5252 }
5353 self .assertEqual (response .json , expected )
5454
55+ # Invalid site
56+ response = self .app_client .get ("/fastpheno/get_bands/12345/feb/band_1" )
57+ expected = {
58+ "wasSuccessful" : False ,
59+ "error" : "Invalid site name" ,
60+ }
61+ self .assertEqual (response .json , expected )
62+
63+ # Invalid month
64+ response = self .app_client .get ("/fastpheno/get_bands/pintendre/1234/band_1" )
65+ expected = {
66+ "wasSuccessful" : False ,
67+ "error" : "Invalid month" ,
68+ }
69+ self .assertEqual (response .json , expected )
70+
71+ # Invalid band
72+ response = self .app_client .get ("/fastpheno/get_bands/NOTASITE/feb/band_x" )
73+ expected = {
74+ "wasSuccessful" : False ,
75+ "error" : "Invalid band" ,
76+ }
77+ self .assertEqual (response .json , expected )
78+
5579 def test_site_genotype_ids (self ):
5680 """This function checks GET request for fastpheno sites for genotype_ids
5781 :return:
@@ -92,9 +116,17 @@ def test_site_genotype_ids(self):
92116 self .assertEqual (response .json , expected )
93117
94118 # Not working version
95- response = self .app_client .get ("/fastpheno/get_trees/NOTAGENOTYPE " )
119+ response = self .app_client .get ("/fastpheno/get_trees/Z " )
96120 expected = {
97121 "wasSuccessful" : False ,
98122 "error" : "There are no data found for the given parameters" ,
99123 }
100124 self .assertEqual (response .json , expected )
125+
126+ # Invalid data
127+ response = self .app_client .get ("/fastpheno/get_trees/NOTVALID" )
128+ expected = {
129+ "wasSuccessful" : False ,
130+ "error" : "Invalid genotype id" ,
131+ }
132+ self .assertEqual (response .json , expected )
0 commit comments