@@ -705,6 +705,15 @@ def test_tesscut_get_sector(patch_post):
705
705
mast .Tesscut .get_sectors (objectname = 'Ceres' , moving_target = True , coordinates = coord )
706
706
assert error_str in str (invalid_query .value )
707
707
708
+ # Testing invalid queries
709
+ with pytest .raises (InvalidQueryError ) as invalid_query :
710
+ mast .Tesscut .get_sectors (objectname = "M101" , product = "spooc" )
711
+ assert "Input product must either be SPOC or TICA." in str (invalid_query .value )
712
+
713
+ with pytest .raises (InvalidQueryError ) as invalid_query :
714
+ mast .Tesscut .get_sectors (objectname = "M101" , product = "TICA" , moving_target = True )
715
+ assert "Only SPOC is available for moving targets queries." in str (invalid_query .value )
716
+
708
717
709
718
def test_tesscut_download_cutouts (patch_post , tmpdir ):
710
719
@@ -754,6 +763,15 @@ def test_tesscut_download_cutouts(patch_post, tmpdir):
754
763
path = str (tmpdir ))
755
764
assert error_str in str (invalid_query .value )
756
765
766
+ # Testing invalid queries
767
+ with pytest .raises (InvalidQueryError ) as invalid_query :
768
+ mast .Tesscut .download_cutouts (objectname = "M101" , product = "spooc" )
769
+ assert "Input product must either be SPOC or TICA." in str (invalid_query .value )
770
+
771
+ with pytest .raises (InvalidQueryError ) as invalid_query :
772
+ mast .Tesscut .download_cutouts (objectname = "M101" , product = "TICA" , moving_target = True )
773
+ assert "Only SPOC is available for moving targets queries." in str (invalid_query .value )
774
+
757
775
758
776
def test_tesscut_get_cutouts (patch_post , tmpdir ):
759
777
@@ -788,6 +806,15 @@ def test_tesscut_get_cutouts(patch_post, tmpdir):
788
806
size = 5 )
789
807
assert error_str in str (invalid_query .value )
790
808
809
+ # Testing invalid queries
810
+ with pytest .raises (InvalidQueryError ) as invalid_query :
811
+ mast .Tesscut .get_cutouts (objectname = "M101" , product = "spooc" )
812
+ assert "Input product must either be SPOC or TICA." in str (invalid_query .value )
813
+
814
+ with pytest .raises (InvalidQueryError ) as invalid_query :
815
+ mast .Tesscut .get_cutouts (objectname = "M101" , product = "TICA" , moving_target = True )
816
+ assert "Only SPOC is available for moving targets queries." in str (invalid_query .value )
817
+
791
818
792
819
######################
793
820
# ZcutClass tests #
0 commit comments