

def test_push_pull_file(self):
    myFile = 'VGhpcyBpcyBteUZpbGUgYXMgYmFzZTY0'
    self.au.push_file('/storage/sdcard0/foo.txt', myFile)
    myFile = self.au.pull_file('/storage/sdcard0/foo.txt')
    self.assertRegexpMatches(myFile, 'VGhpcyBpcyBteUZpbGUgYXMgYmFzZTY0')
    myFile = self.au.pull_file('/storage/sdcard0/foo.txt', decode=True)
    self.assertRegexpMatches(myFile, 'as base64')
    myFile = 'This is myFile as Text'
    myFile = self.au.push_file('/storage/sdcard0/foo.txt', myFile, encode=True)
    myFile = self.au.pull_file('/storage/sdcard0/foo.txt')
    self.assertRegexpMatches(myFile, 'VGhpcyBpcyBteUZpbGUgYXMgVGV4dA==')
    myFile = self.au.pull_file('/storage/sdcard0/foo.txt', decode=True)
    self.assertRegexpMatches(myFile, 'as Text')

dataset/ETHPy150Open jollychang/robotframework-appiumlibrary/tests/keywords/test_androidUtils.py AndroidUtilsTests.test_push_pull_file/original