def test_update_delete_streaming_profile(self):
        name = self.test_id + "_streaming_profile_delete"
        api.create_streaming_profile(
            name,
            representations=[{"transformation": {
                "bit_rate": "5m", "height": 1200, "width": 1200, "crop": "limit"
            }}])
        result = api.update_streaming_profile(
            name,
            representations=[{"transformation": {
                "bit_rate": "5m", "height": 1000, "width": 1000, "crop": "scale"
            }}])
        self.assertIn("representations", result["data"])
        reps = result["data"]["representations"]
        self.assertIsInstance(reps, list)
        # transformation is returned as an array
        self.assertIsInstance(reps[0]["transformation"], list)

        tr = reps[0]["transformation"][0]
        expected = {"bit_rate": "5m", "height": 1000, "width": 1000, "crop": "scale"}
        self.assertDictEqual(expected, tr)

        api.delete_streaming_profile(name)
        result = api.list_streaming_profiles()
        self.assertNotIn(name, [p["name"] for p in result["data"]])
Exemplo n.º 2
0
    def test_create_streaming_profile(self):
        """should create a streaming profile with representations"""
        name = StreamingProfilesTest.test_id + "_streaming_profile"
        result = api.create_streaming_profile(name,
                                              representations=[{
                                                  "transformation": {
                                                      "bit_rate": "5m",
                                                      "height": 1200,
                                                      "width": 1200,
                                                      "crop": "limit"
                                                  }
                                              }])
        self.assertIn("representations", result["data"])
        reps = result["data"]["representations"]
        self.assertIsInstance(reps, list)
        """should return transformation as an array"""
        self.assertIsInstance(reps[0]["transformation"], list)

        tr = reps[0]["transformation"][0]
        expected = {
            "bit_rate": "5m",
            "height": 1200,
            "width": 1200,
            "crop": "limit"
        }
        self.assertDictEqual(expected, tr)
Exemplo n.º 3
0
    def test_update_delete_streaming_profile(self):
        name = StreamingProfilesTest.test_id + "_streaming_profile_delete"
        api.create_streaming_profile(name,
                                     representations=[{
                                         "transformation": {
                                             "bit_rate": "5m",
                                             "height": 1200,
                                             "width": 1200,
                                             "crop": "limit"
                                         }
                                     }])
        result = api.update_streaming_profile(name,
                                              representations=[{
                                                  "transformation": {
                                                      "bit_rate": "5m",
                                                      "height": 1000,
                                                      "width": 1000,
                                                      "crop": "scale"
                                                  }
                                              }])
        self.assertIn("representations", result["data"])
        reps = result["data"]["representations"]
        self.assertIsInstance(reps, list)
        """transformation is returned as an array"""
        self.assertIsInstance(reps[0]["transformation"], list)

        tr = reps[0]["transformation"][0]
        expected = {
            "bit_rate": "5m",
            "height": 1000,
            "width": 1000,
            "crop": "scale"
        }
        self.assertDictEqual(expected, tr)

        api.delete_streaming_profile(name)
        result = api.list_streaming_profiles()
        self.assertNotIn(name, [p["name"] for p in result["data"]])
Exemplo n.º 4
0
    def test_create_streaming_profile(self):
        """should create a streaming profile with representations"""
        name = StreamingProfilesTest.test_id + "_streaming_profile"
        result = api.create_streaming_profile(
            name,
            representations=[
                {"transformation": {"bit_rate": "5m", "height": 1200, "width": 1200, "crop": "limit"}}])
        self.assertIn("representations", result["data"])
        reps = result["data"]["representations"]
        self.assertIsInstance(reps, list)
        """should return transformation as an array"""
        self.assertIsInstance(reps[0]["transformation"], list)

        tr = reps[0]["transformation"][0]
        expected = {"bit_rate": "5m", "height": 1200, "width": 1200, "crop": "limit"}
        self.assertDictEqual(expected, tr)