Esempio n. 1
0
    def test_functional_create_container_and_object_then_list_objects(self):
        names_list = ["AA", "BB", "CC", "DD"]

        scenario = objects.CreateContainerAndObjectThenListObjects(
            self.context)
        scenario.generate_random_name = mock.MagicMock(side_effect=names_list)
        scenario._list_objects = mock.MagicMock()

        scenario.run(objects_per_container=3, object_size=100)

        scenario._list_objects.assert_called_once_with("AA")
Esempio n. 2
0
    def test_create_container_and_object_then_list_objects(self):
        scenario = objects.CreateContainerAndObjectThenListObjects(
            self.context)
        scenario._create_container = mock.MagicMock(return_value="AA")
        scenario._upload_object = mock.MagicMock()
        scenario._list_objects = mock.MagicMock()

        scenario.run(objects_per_container=5, object_size=100)

        self.assertEqual(1, scenario._create_container.call_count)
        self.assertEqual(5, scenario._upload_object.call_count)
        scenario._list_objects.assert_called_once_with("AA")