7 class MkdirDashPTest(unittest.TestCase):
10 os.path.mkdir('./tmp')
15 os.unlink('./tmp/bar')
21 arvados.util.mkdir_dash_p('./tmp/foo')
22 with open('./tmp/bar', 'wb') as f:
24 self.assertRaises(OSError, arvados.util.mkdir_dash_p, './tmp/bar')
27 class RunCommandTestCase(unittest.TestCase):
28 def test_success(self):
29 stdout, stderr = arvados.util.run_command(['echo', 'test'],
30 stderr=subprocess.PIPE)
31 self.assertEqual("test\n", stdout)
32 self.assertEqual("", stderr)
34 def test_failure(self):
35 with self.assertRaises(arvados.errors.CommandFailedError):
36 arvados.util.run_command(['false'])