def test_flags_invalidate_the_other(self): query = GranuleQuery() # if downloadable is set, online_only should be unset query.downloadable() self.assertIn(self.downloadable, query.params) self.assertNotIn(self.online_only, query.params) # if online_only is set, downloadable should be unset query.online_only() self.assertIn(self.online_only, query.params) self.assertNotIn(self.downloadable, query.params)
def test_downloadable_set(self): query = GranuleQuery() # default to True query.downloadable() self.assertIn(self.downloadable, query.params) self.assertEqual(query.params[self.downloadable], True) # explicitly set to False query.downloadable(False) self.assertIn(self.downloadable, query.params) self.assertEqual(query.params[self.downloadable], False)
def test_downloadable_invalid(self): query = GranuleQuery() with self.assertRaises(TypeError): query.downloadable("Invalid Type") self.assertNotIn(self.downloadable, query.params)