Пример #1
0
 def test_parsels(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     out = """Found 6 items
                                 drwx------   - xavierdupre xavierdupre          0 2014-11-18 01:00 .Trash
                                 drwx------   - xavierdupre xavierdupre          0 2014-11-16 02:38 .staging
                                 -rw-r--r--   3 xavierdupre xavierdupre    129.6 K 2014-11-16 02:37 ConfLongDemo_JSI.small.example.txt
                                 drwxr-xr-x   - xavierdupre xavierdupre          0 2014-11-16 02:38 ConfLongDemo_JSI.small.example2.walking.txt
                                 -rw-r--r--   3 xavierdupre xavierdupre    450.6 K 2014-11-20 01:33 paris.2014-11-11_22-00-18.331391.txt
                                 drwxr-xr-x   - xavierdupre xavierdupre          0 2014-11-20 01:53 velib_1hjs""".replace("                                    ", "")
     fLOG(out)
     for _ in out.split("\n"):
         __ = _.split()
         fLOG(len(__), __)
     parse = ASSHClient.parse_lsout(out)
     fLOG(parse.columns)
     assert list(
         parse.columns) == [
         'attributes',
         'code',
         'alias',
         'folder',
         'size',
         'unit',
         'name',
         'isdir']
     assert len(parse) > 0
Пример #2
0
 def setUp(self):
     res = get_codes("CRTERALAB")
     if res is None:
         self.client = None
     else:
         res = [bytes(_, encoding="ascii") for _ in res]
         codes = [res[0], res[2], res[1]]
         if len(codes) >= 7 or len(codes) == 3:
             cl = ASSHClient(*codes)
             try:
                 cl.connect()
             except TimeoutError:
                 # the cluster is not connected
                 self.client = None
                 return None
             self.client = cl
         else:
             self.client = None
Пример #3
0
 def setUp(self):
     res = get_codes("CRTERALAB")
     if res is None:
         self.client = None
     else:
         res = [bytes(_, encoding="ascii") for _ in res]
         codes = [res[0], res[2], res[1]]
         if len(codes) >= 7 or len(codes) == 3:
             cl = ASSHClient(*codes)
             try:
                 cl.connect()
             except TimeoutError:
                 # the cluster is not connected
                 self.client = None
                 return None
             self.client = cl
         else:
             self.client = None
Пример #4
0
    def test_ls(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        line = "-rw-rw-r-- 1 xavierdupre xavierdupre 21546346 Sep 27 11:18 ConfLongDemo_JSI.txt"
        out = ASSHClient.parse_lsout(line, False)
        self.assertEqual(out.shape, (1, 9))
        fLOG(out)
        fLOG(out.columns)
Пример #5
0
    def test_ls(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        line = "-rw-rw-r-- 1 xavierdupre xavierdupre 21546346 Sep 27 11:18 ConfLongDemo_JSI.txt"
        out = ASSHClient.parse_lsout(line, False)
        self.assertEqual(out.shape, (1, 9))
        fLOG(out)
        fLOG(out.columns)
Пример #6
0
 def test_parsels(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     out = """Found 6 items
                                 drwx------   - xavierdupre xavierdupre          0 2014-11-18 01:00 .Trash
                                 drwx------   - xavierdupre xavierdupre          0 2014-11-16 02:38 .staging
                                 -rw-r--r--   3 xavierdupre xavierdupre    129.6 K 2014-11-16 02:37 ConfLongDemo_JSI.small.example.txt
                                 drwxr-xr-x   - xavierdupre xavierdupre          0 2014-11-16 02:38 ConfLongDemo_JSI.small.example2.walking.txt
                                 -rw-r--r--   3 xavierdupre xavierdupre    450.6 K 2014-11-20 01:33 paris.2014-11-11_22-00-18.331391.txt
                                 drwxr-xr-x   - xavierdupre xavierdupre          0 2014-11-20 01:53 velib_1hjs""".replace(
         "                                    ", "")
     fLOG(out)
     for _ in out.split("\n"):
         __ = _.split()
         fLOG(len(__), __)
     parse = ASSHClient.parse_lsout(out)
     fLOG(parse.columns)
     assert list(parse.columns) == [
         'attributes', 'code', 'alias', 'folder', 'size', 'unit', 'name',
         'isdir'
     ]
     assert len(parse) > 0