@@ -101,7 +101,7 @@ def test__function_cardinality_rule_none(self):
101101 - The returned function, when called, has to call the `faker.<function_name>` function
102102 with the provided kwargs.
103103 """
104- # setup
104+ # Setup
105105 instance = Mock ()
106106 function = Mock ()
107107 unique_function = Mock ()
@@ -147,7 +147,7 @@ def test__function_cardinality_rule_unique(self):
147147 - The returned function, when called, has to call the ``faker.unique.<function_name>``
148148 function with the provided kwargs.
149149 """
150- # setup
150+ # Setup
151151 instance = Mock ()
152152 function = Mock ()
153153 unique_function = Mock ()
@@ -169,7 +169,7 @@ def test__function_cardinality_rule_unique(self):
169169
170170 def test__function_cardinality_rule_match (self ):
171171 """Test it when 'cardinality_rule' is 'match'."""
172- # setup
172+ # Setup
173173 instance = Mock ()
174174 function = Mock ()
175175 unique_function = Mock ()
@@ -191,7 +191,7 @@ def test__function_cardinality_rule_match(self):
191191
192192 def test__function_cardinality_rule_missing_attribute (self ):
193193 """Test it when ``cardinality_rule`` attribute is missing."""
194- # setup
194+ # Setup
195195 instance = Mock ()
196196 function = Mock ()
197197 unique_function = Mock ()
@@ -214,11 +214,36 @@ def test__function_cardinality_rule_missing_attribute(self):
214214
215215 def test__function_with_iterables_return (self ):
216216 """Test that ``_function`` returns the values of the iterable."""
217- # setup
217+ # Setup
218+ instance = Mock ()
219+ instance .cardinality_rule = None
220+ function = Mock ()
221+ function .return_value = ('value_1' , 'value_2' )
222+
223+ instance .faker .number = function
224+ instance .function_name = 'number'
225+ instance .function_kwargs = {'type' : 'int' }
226+
227+ # Run
228+ result = AnonymizedFaker ._function (instance )
229+
230+ # Assert
231+ function .assert_called_once_with (type = 'int' )
232+ assert result == 'value_1, value_2'
233+
234+ def test__function_sets__excluded_types (self ):
235+ """Test that ``_function`` will set the `_excluded_types` attribute to `faker`."""
236+
237+ # Setup
238+ class Dummy :
239+ pass
240+
218241 instance = Mock ()
219242 instance .cardinality_rule = None
220243 function = Mock ()
221244 function .return_value = ('value_1' , 'value_2' )
245+ instance .faker .unique = Dummy ()
246+ assert hasattr (instance .faker .unique , '_excluded_types' ) is False
222247
223248 instance .faker .number = function
224249 instance .function_name = 'number'
@@ -230,6 +255,7 @@ def test__function_with_iterables_return(self):
230255 # Assert
231256 function .assert_called_once_with (type = 'int' )
232257 assert result == 'value_1, value_2'
258+ assert hasattr (instance .faker .unique , '_excluded_types' )
233259
234260 @patch ('rdt.transformers.pii.anonymizer.importlib' )
235261 @patch ('rdt.transformers.pii.anonymizer.warnings' )
0 commit comments