Skip to content

Commit 26b6c4d

Browse files
committed
Updated tests for StorePathType to not actually test the functionality of the PathType class.
1 parent 12a5759 commit 26b6c4d

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

utils/build_swift/tests/argparse/test_actions.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,15 @@ def test_default_attributes(self):
255255
self.assertIsInstance(action.type, PathType)
256256

257257
def test_exists(self):
258-
pass
258+
action = actions.StorePathAction(['--foo'], dests=['foo'], exists=True)
259259

260-
def test_executable(self):
261-
parser = ArgumentParser()
262-
parser.add_argument('--foo', action=actions.StorePathAction,
263-
executable=True)
260+
self.assertTrue(action.type.assert_exists)
264261

265-
bash_path = '/bin/bash'
266-
if os.path.exists(bash_path) and os.access(bash_path, os.X_OK):
267-
with self.assertNotRaises(ArgumentTypeError):
268-
parser.parse_args(['--foo', bash_path])
262+
def test_executable(self):
263+
action = actions.StorePathAction(['--foo'], dests=['foo'],
264+
executable=True)
269265

270-
with self.assertRaises(SystemExit):
271-
parser.parse_args(['--foo', __file__])
266+
self.assertTrue(action.type.assert_executable)
272267

273268

274269
class TestToggleTrueAction(TestCase):

0 commit comments

Comments
 (0)