Beispiel #1
0
 def test_tags(self):
     """should successfully upload file """
     result = uploader.upload("tests/logo.png")
     uploader.add_tag("tag1", result["public_id"])
     uploader.add_tag("tag2", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag1", "tag2"])
     uploader.remove_tag("tag1", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag2"])
     uploader.replace_tag("tag3", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag3"])
Beispiel #2
0
 def test_tags(self):
     """should successfully upload file """
     result = uploader.upload("tests/logo.png")
     result2 = uploader.upload("tests/logo.png")
     uploader.add_tag("tag1", [result["public_id"], result2["public_id"]])
     uploader.add_tag("tag2", result["public_id"])
     self.assertEqual(
         api.resource(result["public_id"])["tags"], ["tag1", "tag2"])
     self.assertEqual(api.resource(result2["public_id"])["tags"], ["tag1"])
     uploader.remove_tag("tag1", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag2"])
     uploader.replace_tag("tag3", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag3"])
Beispiel #3
0
 def test_tags(self):
     """should successfully upload file """
     result = uploader.upload(TEST_IMAGE, tags=[UNIQUE_TAG])
     result2 = uploader.upload(TEST_IMAGE, tags=[UNIQUE_TAG])
     uploader.add_tag("tag1", [result["public_id"], result2["public_id"]])
     uploader.add_tag("tag2", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag1", "tag2", UNIQUE_TAG])
     self.assertEqual(api.resource(result2["public_id"])["tags"], ["tag1", UNIQUE_TAG])
     uploader.remove_tag("tag1", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag2", UNIQUE_TAG])
     uploader.replace_tag("tag3", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag3"])
     uploader.replace_tag(UNIQUE_TAG, result["public_id"])
Beispiel #4
0
 def test_tags(self):
     """should successfully upload file """
     result = uploader.upload(TEST_IMAGE, tags=[UNIQUE_TAG])
     result2 = uploader.upload(TEST_IMAGE, tags=[UNIQUE_TAG])
     uploader.add_tag("tag1", [result["public_id"], result2["public_id"]])
     uploader.add_tag("tag2", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag1", "tag2", UNIQUE_TAG])
     self.assertEqual(api.resource(result2["public_id"])["tags"], ["tag1", UNIQUE_TAG])
     uploader.remove_tag("tag1", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag2", UNIQUE_TAG])
     uploader.replace_tag("tag3", result["public_id"])
     self.assertEqual(api.resource(result["public_id"])["tags"], ["tag3"])
     uploader.replace_tag(UNIQUE_TAG, result["public_id"])