def test_path_specified_fullpath(self):

        args = restore.parse_args(['', '/a/path'], "ignored")

        self.assertEqual((Command.RunRestore,
                          {'path': '/a/path',
                           'sort': 'date',
                           'trash_dir': None}),
                         args)
    def test_path_specified_relative_path(self):

        args = restore.parse_args(['', 'path'], "curdir")

        self.assertEqual((Command.RunRestore,
                          {'path': 'curdir/path',
                           'sort': 'date',
                           'trash_dir': None}),
                         args)
    def test_default_path(self):

        args = restore.parse_args([''], "curdir")

        self.assertEqual((Command.RunRestore,
                          {'path': 'curdir',
                           'sort': 'date',
                           'trash_dir': None}),
                         args)
示例#4
0
 def test_show_version(self):
     args = restore.parse_args(['', '--version'], None)
     self.assertEqual(True, args.version)
示例#5
0
 def test_path_specified(self):
     args = restore.parse_args(['', '/a/path'], None)
     self.assertEqual('/a/path', args.path)
     self.assertEqual(False, args.version)
     self.assertEqual('date', args.sort)
示例#6
0
 def test_default_path(self):
     args = restore.parse_args([''], "curdir")
     self.assertEqual('curdir', args.path)
    def test_show_version(self):
        args = restore.parse_args(['', '--version'], "ignored")

        self.assertEqual((Command.PrintVersion, None), args)