def test_get_root(self):
     "Get the root directory from the helper"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     root = self.ihelper.root()
     self.assertNotEqual(root, None)
     self.assertEqual(type(root), str)
 def test_get_cwd(self):
     "Get the current directory from the helper"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     cwd = self.ihelper.cwd()
     self.assertNotEqual(cwd, None)
     self.assertEqual(type(cwd), str)
 def test_get_session(self):
     "Get the session from the helper"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     sess = self.ihelper.session()
     self.assertNotEqual(sess, None)
     self.assertEqual(type(sess), iRODSSession)
 def test_disconnect(self):
     "Open connection and then close it"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     self.assertTrue(self.ihelper.is_connected())
     self.ihelper.disconnect()
     self.assertFalse(self.ihelper.is_connected())
 def test_cwd_is_root(self):
     "The initial working directory should be the root directory"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     root = self.ihelper.root()
     cwd = self.ihelper.cwd()
     self.assertEqual(cwd, root)
 def setUp(self):
     "Initialize the test case"
     self.ihelper = ih.IrodsHelper()  # create instance of class under test
     self.assertTrue(
         self.ihelper.is_connected())  # sanity check: assert connected
     upfile = "context.py"  # build a test directory tree
     upfile2 = "metadata-keys.txt"
     self.ihelper.mkdir("test0/test1/test3")
     self.ihelper.mkdir("test0/test1/test4")
     self.ihelper.mkdir("test0/test2/test5")
     self.ihelper.put_file(upfile, "test0/test1/" + upfile)
     self.ihelper.put_file(upfile, "test0/test1/test3/" + upfile)
     self.ihelper.put_file(upfile, "test0/test2/test5/" + upfile)
     self.ihelper.put_file(upfile2, "test0/test2/test5/" + upfile2)
     self.ihelper.cd_down("test0")
Beispiel #7
0
 def setUp(self):
     "Initialize the test case"
     self.ihelper = ih.IrodsHelper()
     self.assertTrue(self.ihelper.is_connected())
 def setUp(self):
     "Initialize the test case"
     self.ihelper = ih.IrodsHelper()  # create instance of class under test
     self.assertTrue(
         self.ihelper.is_connected())  # sanity check: assert connected
 def test_connect_envfile(self):
     "Make connection using options specifying env file"
     self.ihelper = ih.IrodsHelper(options=self.default_options)
     self.assertNotEqual(self.ihelper, None)
     self.assertTrue(self.ihelper.is_connected())
 def test_connect(self):
     "Make default connection"
     self.ihelper = ih.IrodsHelper(connect=False)  # do not connect in ctor
     self.assertNotEqual(self.ihelper, None)
     self.ihelper.connect()  # connect explicitly
     self.assertTrue(self.ihelper.is_connected())
 def test_connect_ctor(self):
     "A default connection is made by the constructor"
     self.ihelper = ih.IrodsHelper()
     self.assertNotEqual(self.ihelper, None)
     self.assertTrue(self.ihelper.is_connected())