Esempio n. 1
0
 def test_read_write(self):
     with open(self.filename, 'w') as pyfile:
         pass
     with open(self.filename, 'w+') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, 'w+')
         test_py3c.file_fwrite(f, "hello")
         test_py3c.file_fseek(f, 0)
         val = test_py3c.file_fread(f)
         self.assertEqual(val, "hello")
Esempio n. 2
0
 def test_read_write(self):
     with open(self.filename, 'w') as pyfile:
         pass
     with open(self.filename, 'w+') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, 'w+')
         test_py3c.file_fwrite(f, "hello")
         test_py3c.file_fseek(f, 0)
         val = test_py3c.file_fread(f)
         self.assertEqual(val, "hello")
Esempio n. 3
0
 def test_write(self):
     with open(self.filename, 'w') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, "w")
         test_py3c.file_fwrite(f, "hello")
     with open(self.filename, 'r') as pyfile:
         self.assertEqual(pyfile.read(), 'hello')
Esempio n. 4
0
 def test_write(self):
     with open(self.filename, 'w') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, "w")
         test_py3c.file_fwrite(f, "hello")
     with open(self.filename, 'r') as pyfile:
         self.assertEqual(pyfile.read(), 'hello')