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'))
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"))