コード例 #1
0
ファイル: test_api.py プロジェクト: cloudinary/pycloudinary
 def test12a_transformations_cursor(self, mocker):
     """ should allow listing transformations with cursor """
     mocker.return_value = MOCK_RESPONSE
     api.transformation(API_TEST_TRANS_SCALE100, next_cursor='2412515', max_results=10)
     params = mocker.call_args[0][2]
     self.assertEqual(params['next_cursor'], '2412515')
     self.assertEqual(params['max_results'], 10)
コード例 #2
0
ファイル: api_test.py プロジェクト: nloadholtes/pycloudinary
 def test13_transformation_metadata(self):
     """ should allow getting transformation metadata """
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 100}])
     transformation = api.transformation({"crop": "scale", "width": 100})
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 100}])
コード例 #3
0
ファイル: test_api.py プロジェクト: SF92/pycloudinary
 def test13_transformation_metadata(self):
     """ should allow getting transformation metadata """
     transformation = api.transformation(API_TEST_TRANS_SCALE100_STR)
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [API_TEST_TRANS_SCALE100])
     transformation = api.transformation(API_TEST_TRANS_SCALE100)
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [API_TEST_TRANS_SCALE100])
コード例 #4
0
ファイル: test_api.py プロジェクト: cloudinary/pycloudinary
 def test13_transformation_metadata(self):
     """ should allow getting transformation metadata """
     transformation = api.transformation(API_TEST_TRANS_SCALE100_STR)
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [API_TEST_TRANS_SCALE100])
     transformation = api.transformation(API_TEST_TRANS_SCALE100)
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [API_TEST_TRANS_SCALE100])
コード例 #5
0
ファイル: api_test.py プロジェクト: julianfox/pycloudinary
 def test13_transformation_metadata(self):
     """ should allow getting transformation metadata """
     transformation = api.transformation("c_scale,w_100")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 100}])
     transformation = api.transformation({"crop": "scale", "width": 100})
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 100}])
コード例 #6
0
 def test16_transformation_delete(self):
     """ should allow deleting named transformation """
     api.create_transformation(API_TEST_TRANS2, {
         "crop": "scale",
         "width": 103
     })
     api.transformation(API_TEST_TRANS2)
     api.delete_transformation(API_TEST_TRANS2)
     self.assertRaises(api.NotFound, api.transformation, API_TEST_TRANS2)
コード例 #7
0
 def test12a_transformations_cursor(self, mocker):
     """ should allow listing transformations with cursor """
     mocker.return_value = MOCK_RESPONSE
     api.transformation(API_TEST_TRANS_SCALE100,
                        next_cursor='2412515',
                        max_results=10)
     params = mocker.call_args[0][2]
     self.assertEqual(params['next_cursor'], '2412515')
     self.assertEqual(params['max_results'], 10)
コード例 #8
0
ファイル: api_test.py プロジェクト: nloadholtes/pycloudinary
 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)
コード例 #9
0
ファイル: api_test.py プロジェクト: tpof314/pycloudinary
 def test16_transformation_delete(self):
     """ should allow deleting named transformation """
     api.create_transformation("api_test_transformation2", {
         "crop": "scale",
         "width": 103
     })
     api.transformation("api_test_transformation2")
     api.delete_transformation("api_test_transformation2")
     self.assertRaises(api.NotFound, api.transformation,
                       ("api_test_transformation2"))
コード例 #10
0
ファイル: api_test.py プロジェクト: tpof314/pycloudinary
 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)
コード例 #11
0
ファイル: api_test.py プロジェクト: julianfox/pycloudinary
 def test15_transformation_create(self):
     """ should allow creating named transformation """
     api.create_transformation("api_test_transformation", {"crop": "scale", "width": 102})
     transformation = api.transformation("api_test_transformation")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], True)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 102}])
     self.assertEqual(transformation["used"], False)
コード例 #12
0
ファイル: api_test.py プロジェクト: nloadholtes/pycloudinary
 def test15_transformation_create(self):
     """ should allow creating named transformation """
     api.create_transformation("api_test_transformation", {"crop": "scale", "width": 102})
     transformation = api.transformation("api_test_transformation")
     self.assertNotEqual(transformation, None)
     self.assertEqual(transformation["allowed_for_strict"], True)
     self.assertEqual(transformation["info"], [{"crop": "scale", "width": 102}])
     self.assertEqual(transformation["used"], False)
コード例 #13
0
ファイル: test_api.py プロジェクト: MaorGariv/pycloudinary
 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)
コード例 #14
0
ファイル: test_api.py プロジェクト: cloudinary/pycloudinary
 def test16_transformation_delete(self):
     """ should allow deleting named transformation """
     api.create_transformation(API_TEST_TRANS2, {"crop": "scale", "width": 103})
     api.transformation(API_TEST_TRANS2)
     api.delete_transformation(API_TEST_TRANS2)
     self.assertRaises(api.NotFound, api.transformation, API_TEST_TRANS2)
コード例 #15
0
ファイル: api_test.py プロジェクト: tpof314/pycloudinary
 def test17_transformation_implicit(self):
     """ should allow deleting implicit transformation """
     api.transformation("c_scale,w_100")
     api.delete_transformation("c_scale,w_100")
     self.assertRaises(api.NotFound, api.transformation, ("c_scale,w_100"))
コード例 #16
0
ファイル: test_api.py プロジェクト: SF92/pycloudinary
 def test12a_transformations_cursor(self, mocker):
     """ should allow listing transformations with cursor """
     mocker.return_value = MOCK_RESPONSE
     api.transformation(API_TEST_TRANS_SCALE100, next_cursor=NEXT_CURSOR, max_results=10)
     self.assertEqual(get_param(mocker, 'next_cursor'), NEXT_CURSOR)
     self.assertEqual(get_param(mocker, 'max_results'), 10)
コード例 #17
0
ファイル: api_test.py プロジェクト: nloadholtes/pycloudinary
 def test16_transformation_delete(self):
     """ should allow deleting named transformation """
     api.create_transformation("api_test_transformation2", {"crop": "scale", "width": 103})
     api.transformation("api_test_transformation2")
     api.delete_transformation("api_test_transformation2")
     self.assertRaises(api.NotFound, api.transformation, ("api_test_transformation2"))
コード例 #18
0
ファイル: api_test.py プロジェクト: nloadholtes/pycloudinary
 def test17_transformation_implicit(self):
     """ should allow deleting implicit transformation """
     api.transformation("c_scale,w_100")
     api.delete_transformation("c_scale,w_100")
     self.assertRaises(api.NotFound, api.transformation, ("c_scale,w_100"))