mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
34
third_party/python/Lib/test/test_startfile.py
vendored
Normal file
34
third_party/python/Lib/test/test_startfile.py
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Ridiculously simple test of the os.startfile function for Windows.
|
||||
#
|
||||
# empty.vbs is an empty file (except for a comment), which does
|
||||
# nothing when run with cscript or wscript.
|
||||
#
|
||||
# A possible improvement would be to have empty.vbs do something that
|
||||
# we can detect here, to make sure that not only the os.startfile()
|
||||
# call succeeded, but also the script actually has run.
|
||||
|
||||
import unittest
|
||||
from test import support
|
||||
import os
|
||||
import sys
|
||||
from os import path
|
||||
|
||||
startfile = support.get_attribute(os, 'startfile')
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
def test_nonexisting(self):
|
||||
self.assertRaises(OSError, startfile, "nonexisting.vbs")
|
||||
|
||||
def test_empty(self):
|
||||
# We need to make sure the child process starts in a directory
|
||||
# we're not about to delete. If we're running under -j, that
|
||||
# means the test harness provided directory isn't a safe option.
|
||||
# See http://bugs.python.org/issue15526 for more details
|
||||
with support.change_cwd(path.dirname(sys.executable)):
|
||||
empty = path.join(path.dirname(__file__), "empty.vbs")
|
||||
startfile(empty)
|
||||
startfile(empty, "open")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue