Example #1
0
    def test_put(self):
        '''
        Test for create a new container, or upload an object to a container.
        '''
        with patch.object(swift, '_auth', MagicMock()):
            self.assertTrue(swift.put('mycontainer'))

            self.assertTrue(swift.put('mycontainer', path='myfile.png',
                                      local_file='/tmp/myfile.png'))

            self.assertFalse(swift.put('mycontainer', path='myfile.png'))
Example #2
0
    def test_put(self):
        '''
        Test for create a new container, or upload an object to a container.
        '''
        with patch.object(swift, '_auth', MagicMock()):
            self.assertTrue(swift.put('mycontainer'))

            self.assertTrue(swift.put('mycontainer', path='myfile.png',
                                      local_file='/tmp/myfile.png'))

            self.assertFalse(swift.put('mycontainer', path='myfile.png'))
Example #3
0
    def test_put(self):
        """
        Test for create a new container, or upload an object to a container.
        """
        with patch.object(swift, "_auth", MagicMock()):
            self.assertTrue(swift.put("mycontainer"))

            self.assertTrue(
                swift.put("mycontainer",
                          path="myfile.png",
                          local_file="/tmp/myfile.png"))

            self.assertFalse(swift.put("mycontainer", path="myfile.png"))