def test_from_dict_with_changes(self): options = BitmapIndexOptions.from_dict({ "unique_key": QueryConstants.THIS_ATTRIBUTE_NAME, }) self.assertEqual(QueryConstants.THIS_ATTRIBUTE_NAME, options.unique_key) self.assertEqual(UniqueKeyTransformation.OBJECT, options.unique_key_transformation)
def test_from_dict_defaults(self): options = BitmapIndexOptions.from_dict({}) self.assertEqual(QueryConstants.KEY_ATTRIBUTE_NAME, options.unique_key) self.assertEqual(UniqueKeyTransformation.OBJECT, options.unique_key_transformation)
def test_from_dict(self): with self.assertRaises(InvalidConfigurationError): BitmapIndexOptions.from_dict({"unknown_key": 1})