def test_immutability(self): """ Make sure that the Catalog class is immutable """ catalog = Catalog(self.SAMPLE_CATALOG_PATH) with self.assertRaises(AttributeError): catalog.path = self.SAMPLE_INCOMPLETE_PATH with self.assertRaises(AttributeError): del catalog.path for index in xrange(len(catalog)): star = StarTest.random() with self.assertRaises(TypeError): catalog[index] = star with self.assertRaises(TypeError): del catalog[index]