def test_parse_cutout_size_deg(self): """ Size in degrees given. """ co_args = autils.parse_cutout_size({'sizeDeg': '0.005'}, required=True) assert co_args is not None assert co_args != {} assert 'size' in co_args assert co_args.get('size') == 0.005 assert 'units' in co_args assert co_args.get('units') == u.deg assert 'co_size' in co_args
def test_parse_cutout_size_sec(self): """ Size in arc seconds given. """ co_args = autils.parse_cutout_size({'sizeArcSec': '1256'}, required=True) assert co_args is not None assert co_args != {} assert 'size' in co_args assert co_args.get('size') == 1256 assert 'units' in co_args assert co_args.get('units') == u.arcsec assert 'co_size' in co_args
def test_parse_cutout_size_min(self): """ Size in arc minutes given. """ co_args = autils.parse_cutout_size({'sizeArcMin': '3.2'}, required=True) assert co_args is not None assert co_args != {} assert 'size' in co_args assert co_args.get('size') == 3.2 assert 'units' in co_args assert co_args.get('units') == u.arcmin assert 'co_size' in co_args
def test_parse_cutout_size_empty_req(self): """ Empty size given, but not required. """ with pytest.raises(RequestException, match=self.size_convert_emsg) as reqex: co_args = autils.parse_cutout_size({'sizeArcMin': ' '}, required=True)
def test_parse_cutout_size_nosize_req(self): """ No size in any form given. """ with pytest.raises(RequestException, match=self.size_emsg) as reqex: co_args = autils.parse_cutout_size({}, required=True)
def test_parse_cutout_size_empty(self): """ Empty size given, when not required, but still erroneous. """ with pytest.raises(RequestException, match=self.size_convert_emsg) as reqex: co_args = autils.parse_cutout_size({'sizeArcMin': ' '})
def test_parse_cutout_size_nosize(self): """ No size in any form given but not required. """ co_args = autils.parse_cutout_size({}) assert co_args == {}