예제 #1
0
 def test_read(self):
     with open(self.filename, 'w') as pyfile:
         pyfile.write('hello')
     with open(self.filename, 'r') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, "r")
         val = test_py3c.file_fread(f)
         self.assertEqual(val, "hello")
예제 #2
0
파일: __main__.py 프로젝트: eye3/py3c
 def test_read(self):
     with open(self.filename, 'w') as pyfile:
         pyfile.write('hello')
     with open(self.filename, 'r') as pyfile:
         f = test_py3c.file_asfilewithmode(pyfile, "r")
         val = test_py3c.file_fread(f)
         self.assertEqual(val, "hello")
예제 #3
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")
예제 #4
0
파일: __main__.py 프로젝트: eye3/py3c
 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")
예제 #5
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')
예제 #6
0
파일: __main__.py 프로젝트: eye3/py3c
 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')