Ejemplo n.º 1
0
 def test14_transformation_update(self, mocker):
     """ should allow updating transformation allowed_for_strict """
     mocker.return_value = MOCK_RESPONSE
     api.update_transformation(API_TEST_TRANS_SCALE100_STR, allowed_for_strict=True)
     args, kargs = mocker.call_args
     self.assertEqual(args[0], 'PUT')
     self.assertTrue(get_uri(args).endswith('/transformations/{0}'.format(API_TEST_TRANS_SCALE100_STR)))
     self.assertTrue(get_params(args)['allowed_for_strict'])
Ejemplo n.º 2
0
 def test15a_transformation_unsafe_update(self):
     """ should allow unsafe update of named transformation """
     api.create_transformation(API_TEST_TRANS3, {"crop": "scale", "width": 102})
     api.update_transformation(API_TEST_TRANS3, unsafe_update={"crop": "scale", "width": 103})
     transformation = api.transformation(API_TEST_TRANS3)
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 103}])
     self.assertEqual(transformation["used"], False)
Ejemplo n.º 3
0
 def test14_transformation_update(self, mocker):
     """ should allow updating transformation allowed_for_strict """
     mocker.return_value = MOCK_RESPONSE
     api.update_transformation("c_scale,w_100", allowed_for_strict=True)
     args, kargs = mocker.call_args
     self.assertEqual(args[0], 'PUT')
     self.assertTrue(get_uri(args).endswith('/transformations/c_scale,w_100'))
     self.assertTrue(get_params(args)['allowed_for_strict'])
Ejemplo n.º 4
0
 def test14_transformation_update(self, mocker):
     """ should allow updating transformation allowed_for_strict """
     mocker.return_value = MOCK_RESPONSE
     api.update_transformation(API_TEST_TRANS_SCALE100_STR, allowed_for_strict=True)
     args, kargs = mocker.call_args
     self.assertEqual(args[0], 'PUT')
     self.assertTrue(get_uri(args).endswith('/transformations'))
     self.assertTrue(get_params(args)['allowed_for_strict'])
     self.assertEqual(API_TEST_TRANS_SCALE100_STR, get_params(args)['transformation'])
Ejemplo n.º 5
0
 def test14_transformation_update(self, mocker):
     """ should allow updating transformation allowed_for_strict """
     mocker.return_value = MOCK_RESPONSE
     api.update_transformation("c_scale,w_100", allowed_for_strict=True)
     args, kargs = mocker.call_args
     self.assertEqual(args[0], 'PUT')
     self.assertTrue(
         get_uri(args).endswith('/transformations/c_scale,w_100'))
     self.assertTrue(get_params(args)['allowed_for_strict'])
Ejemplo n.º 6
0
 def test14_transformation_update(self):
     """ should allow updating transformation allowed_for_strict """
     api.update_transformation("c_scale,w_100", allowed_for_strict=True)
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], True)
     api.update_transformation("c_scale,w_100", allowed_for_strict=False)
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], False)
Ejemplo n.º 7
0
 def test14_transformation_update(self):
     """ should allow updating transformation allowed_for_strict """
     api.update_transformation("c_scale,w_100", allowed_for_strict=True)
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], True)
     api.update_transformation("c_scale,w_100", allowed_for_strict=False)
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], False)