1. Shu Zong Chen
  2. fakeos

Commits

Shu Zong Chen  committed 03e8f55

stub files for other things

  • Participants
  • Parent commits f8170ae
  • Branches default

Comments (0)

Files changed (3)

File fakeos/fakefs.py

View file
+
+
+_DATA = {}
+
+def get_file(fn):
+	return _DATA[fn]
+
+def set_file(fn, data):
+	_DATA[fn] = data

File fakeos/fakeos.py

View file
+import os as _os
+
+class os(object):
+	pass
+
+os.name = _os.name
+os.environ = _os.environ

File test.py

View file
+from fakeos import os, open
+
+with open('fish.txt') as fh:
+	print fh.read()
+