Revision 9af3a427 kamaki/clients/test.py

b/kamaki/clients/test.py
159 159
    def set_header(self, name, value):
160 160
        pass
161 161

  
162
    def set_param(self, name, value):
163
        pass
164

  
162 165

  
163 166
class FR(object):
164 167
    json = None
......
282 285
            else:
283 286
                self.assertEqual(num_of_calls, len(SH.mock_calls))
284 287

  
288
    @patch('%s.FakeConnection.set_param' % __name__)
289
    def test_set_param(self, SP):
290
        num_of_calls = 0
291
        for name, value, condition in product(
292
                ('n4m3', '', None),
293
                ('v41u3', None, 42),
294
                (True, False, None, 1, '')):
295
            self.client.set_param(name, value, iff=condition)
296
            if condition:
297
                self.assertEqual(SP.mock_calls[-1], call(name, value))
298
                num_of_calls += 1
299
            else:
300
                self.assertEqual(num_of_calls, len(SP.mock_calls))
301

  
285 302

  
286 303
#  TestCase auxiliary methods
287 304

  

Also available in: Unified diff