Beispiel #1
0
    def test_get(self):
        '''
        Test for list the contents of a container,
        or return an object from a container.
        '''
        with patch.object(swift, '_auth', MagicMock()):
            self.assertTrue(swift.get())

            self.assertTrue(swift.get('mycontainer'))

            self.assertTrue(swift.get('mycontainer', path='myfile.png',
                                      return_bin=True))

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

            self.assertFalse(swift.get('mycontainer', path='myfile.png'))
Beispiel #2
0
    def test_get(self):
        '''
        Test for list the contents of a container,
        or return an object from a container.
        '''
        with patch.object(swift, '_auth', MagicMock()):
            self.assertTrue(swift.get())

            self.assertTrue(swift.get('mycontainer'))

            self.assertTrue(swift.get('mycontainer', path='myfile.png',
                                      return_bin=True))

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

            self.assertFalse(swift.get('mycontainer', path='myfile.png'))
    def test_get(self):
        """
        Test for list the contents of a container,
        or return an object from a container.
        """
        with patch.object(swift, "_auth", MagicMock()):
            self.assertTrue(swift.get())

            self.assertTrue(swift.get("mycontainer"))

            self.assertTrue(
                swift.get("mycontainer", path="myfile.png", return_bin=True))

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

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