1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583
|
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*-
#
# Copyright 2002 Ben Escoto
# Copyright 2007 Kenneth Loafman
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# Duplicity is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with duplicity; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import copy
import shlex
import unittest
import pytest
from duplicity import (
cli_main,
gpg,
)
from duplicity.cli_data import *
from duplicity.cli_util import *
from testing import _runtest_dir
from testing.unit import UnitTestCase
@unittest.skipIf(os.environ.get("USER", "") == "buildd", "Skip test on Launchpad")
class CommandlineTest(UnitTestCase):
"""
Test parse_commandline_options
"""
good_args = {
"count": "5",
"remove_time": "100",
"source_path": "foo/bar",
"source_url": "file://duptest",
"target_path": "foo/bar",
"target_url": "file://duptest",
}
def setUp(self):
super().setUp()
log.setup()
config.gpg_profile = gpg.GPGProfile()
os.makedirs("foo/bar", exist_ok=True)
os.makedirs("inc", exist_ok=True)
os.makedirs("full", exist_ok=True)
def tearDown(self):
log.shutdown()
super().tearDown()
def run_all_commands_with_errors(self, new_args, err_msg):
"""
Test all commands with the supplied argument list.
Only test command if new_args contains needed arg.
"""
test_args = copy.copy(self.good_args)
test_args.update(new_args)
for var in DuplicityCommands.__dict__.keys():
if var.startswith("__"):
continue
cmd = var2cmd(var)
runtest = False
args = DuplicityCommands.__dict__[var]
cline = [cmd]
for arg in args:
cline.append(test_args[arg])
if arg in new_args:
runtest = True
if runtest:
with self.assertRaisesRegex(cli_main.CommandLineError, err_msg) as cm:
cli_main.process_command_line(cline)
@pytest.mark.usefixtures("redirect_stdin")
def test_full_command(self):
"""
test backup, restore, verify with explicit commands
"""
for cmd in ["cleanup"] + cli_main.CommandAliases.cleanup:
cli_main.process_command_line(f"{cmd} file://duptest".split())
self.assertEqual(config.action, "cleanup")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["collection-status"] + cli_main.CommandAliases.collection_status:
cli_main.process_command_line(f"{cmd} file://duptest".split())
self.assertEqual(config.action, "collection-status")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["full"] + cli_main.CommandAliases.full:
cli_main.process_command_line(f"{cmd} foo/bar file://duptest".split())
self.assertEqual(config.action, "full")
self.assertTrue(config.source_path.endswith("foo/bar"))
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["incremental"] + cli_main.CommandAliases.incremental:
cli_main.process_command_line(f"{cmd} foo/bar file://duptest".split())
self.assertEqual(config.action, "inc")
self.assertTrue(config.source_path.endswith("foo/bar"))
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["list-current-files"] + cli_main.CommandAliases.list_current_files:
cli_main.process_command_line(f"{cmd} file://duptest".split())
self.assertEqual(config.action, "list-current-files")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["remove-all-but-n-full"] + cli_main.CommandAliases.remove_all_but_n_full:
cli_main.process_command_line(f"{cmd} 5 file://duptest".split())
self.assertEqual(config.action, "remove-all-but-n-full")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["remove-all-inc-of-but-n-full"] + cli_main.CommandAliases.remove_all_inc_of_but_n_full:
cli_main.process_command_line(f"{cmd} 5 file://duptest".split())
self.assertEqual(config.action, "remove-all-inc-of-but-n-full")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["remove-older-than"] + cli_main.CommandAliases.remove_older_than:
cli_main.process_command_line(f"{cmd} 100 file://duptest".split())
self.assertEqual(config.action, "remove-older-than")
self.assertEqual(config.target_url, "file://duptest")
for cmd in ["restore"] + cli_main.CommandAliases.restore:
cli_main.process_command_line(f"{cmd} file://duptest foo/bar".split())
self.assertEqual(config.action, "restore")
self.assertTrue(config.target_path.endswith("foo/bar"))
self.assertEqual(config.source_url, "file://duptest")
for cmd in ["verify"] + cli_main.CommandAliases.verify:
cli_main.process_command_line(f"{cmd} file://duptest foo/bar".split())
self.assertEqual(config.action, "verify")
self.assertTrue(config.target_path.endswith("foo/bar"))
self.assertEqual(config.source_url, "file://duptest")
@pytest.mark.usefixtures("redirect_stdin")
def test_full_command_errors_reversed_args(self):
"""
test backup, restore, verify with explicit commands - reversed arg
"""
new_args = {
"source_path": "file://duptest",
"source_url": "foo/bar",
"target_path": "file://duptest",
"target_url": "foo/bar",
}
err_msg = "should be url|should be pathname"
self.run_all_commands_with_errors(new_args, err_msg)
@pytest.mark.usefixtures("redirect_stdin")
def test_full_command_errors_bad_url(self):
"""
test backup, restore, verify with explicit commands - bad url
"""
new_args = {
"source_url": "file:/duptest",
"target_url": "file:/duptest",
}
err_msg = "should be url"
self.run_all_commands_with_errors(new_args, err_msg)
@pytest.mark.usefixtures("redirect_stdin")
def test_full_command_errors_bad_integer(self):
"""
test backup, restore, verify with explicit commands - bad integer
"""
new_args = {
"count": "foo",
}
err_msg = "not an int"
self.run_all_commands_with_errors(new_args, err_msg)
@pytest.mark.usefixtures("redirect_stdin")
def test_full_command_errors_bad_time_string(self):
"""
test backup, restore, verify with explicit commands - bad time string
"""
new_args = {
"remove_time": "foo",
}
err_msg = "Bad time string"
self.run_all_commands_with_errors(new_args, err_msg)
@pytest.mark.usefixtures("redirect_stdin")
def test_option_aliases(self):
"""
test short option aliases
"""
cline = "ib foo/bar file:///target_url -v 9".split()
cli_main.process_command_line(cline)
self.assertEqual(log.getverbosity(), log.DEBUG)
cline = "rb file:///source_url foo/bar -t 10000".split()
cli_main.process_command_line(cline)
self.assertEqual(config.restore_time, 10000)
cline = "rb file:///source_url foo/bar --time 10000".split()
cli_main.process_command_line(cline)
self.assertEqual(config.restore_time, 10000)
@pytest.mark.usefixtures("redirect_stdin")
def test_encryption_options(self):
"""
test encrypt/sign key handling
"""
start = "ib foo/bar file:///target_url "
keys = (
"DEADDEAD",
"DEADDEADDEADDEAD",
"DEADDEADDEADDEADDEADDEADDEADDEADDEADDEAD",
)
for key in keys:
cline = f"{start} --encrypt-key={key}".split()
cli_main.process_command_line(cline)
self.assertEqual(config.gpg_profile.recipients, [key])
cline = f"{start} --encrypt-sign-key={key}".split()
cli_main.process_command_line(cline)
self.assertEqual(config.gpg_profile.recipients, [key])
self.assertEqual(config.gpg_profile.sign_key, key)
cline = f"{start} --hidden-encrypt-key={key}".split()
cli_main.process_command_line(cline)
self.assertEqual(config.gpg_profile.hidden_recipients, [key])
cline = f"{start} --sign-key={key}".split()
cli_main.process_command_line(cline)
self.assertEqual(config.gpg_profile.sign_key, key)
@pytest.mark.usefixtures("redirect_stdin")
def test_implied_commands(self):
"""
test implied commands
"""
cline = "foo/bar file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "foo/bar")
self.assertEqual(config.target_url, "file:///target_url")
cline = "file:///source_url foo/bar".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "restore")
self.assertEqual(config.source_url, "file:///source_url")
self.assertEqual(config.target_path, "foo/bar")
cline = "-v9 foo/bar file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "foo/bar")
self.assertEqual(config.target_url, "file:///target_url")
cline = "-v9 file:///source_url foo/bar".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "restore")
self.assertEqual(config.source_url, "file:///source_url")
self.assertEqual(config.target_path, "foo/bar")
cline = "foo/bar -v9 file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "foo/bar")
self.assertEqual(config.target_url, "file:///target_url")
cline = "file:///source_url -v9 foo/bar".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "restore")
self.assertEqual(config.source_url, "file:///source_url")
self.assertEqual(config.target_path, "foo/bar")
cline = "--verbosity n foo/bar file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "foo/bar")
self.assertEqual(config.target_url, "file:///target_url")
cline = "--verbosity n file:///source_url foo/bar".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "restore")
self.assertEqual(config.source_url, "file:///source_url")
self.assertEqual(config.target_path, "foo/bar")
cline = "foo/bar --verbosity n file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "foo/bar")
self.assertEqual(config.target_url, "file:///target_url")
cline = "file:///source_url --verbosity n foo/bar".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "restore")
self.assertEqual(config.source_url, "file:///source_url")
self.assertEqual(config.target_path, "foo/bar")
# this incremental misses the path argument
with self.assertRaises(CommandLineError) as cm:
cline = "inc file:///target_url".split()
cli_main.process_command_line(cline)
# this full backup lacks the path argument
with self.assertRaises(CommandLineError) as cm:
cline = "full file:///target_url".split()
cli_main.process_command_line(cline)
# implied inc works if '/' supplied
cline = "inc/ file:///target_url".split()
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.source_path, "inc/")
self.assertEqual(config.target_url, "file:///target_url")
@pytest.mark.usefixtures("redirect_stdin")
def test_miscellaneous(self):
"""
test miscellaneous parameters
"""
start = "ib foo/bar file:///target_url"
# check defaults, might add more asserts here
cline = start.split()
cli_main.process_command_line(cline)
self.assertEqual(config.print_statistics, True)
cline = f"{start} --no-print-statistics".split()
cli_main.process_command_line(cline)
self.assertEqual(config.print_statistics, False)
@pytest.mark.usefixtures("redirect_stdin")
def test_integer_args(self):
"""
test implied commands
"""
cline = "foo/bar file:///target_url --copy-blocksize=1024 --volsize=1024".split()
cli_main.process_command_line(cline)
self.assertEqual(config.copy_blocksize, 1024 * 1024)
self.assertEqual(config.volsize, 1024 * 1024 * 1024)
with self.assertRaises(CommandLineError) as cm:
cline = "foo/bar file:///target_url --copy-blocksize=foo --volsize=1024".split()
cli_main.process_command_line(cline)
with self.assertRaises(CommandLineError) as cm:
cline = "foo/bar file:///target_url --copy-blocksize=1024 --volsize=foo".split()
cli_main.process_command_line(cline)
@pytest.mark.usefixtures("redirect_stdin")
def test_bad_command(self):
"""
test bad commands
"""
with self.assertRaises(CommandLineError) as cm:
cline = "fbx foo/bar file:///target_url".split()
cli_main.process_command_line(cline)
with self.assertRaises(CommandLineError) as cm:
cline = "rbx file:///target_url foo/bar".split()
cli_main.process_command_line(cline)
@pytest.mark.usefixtures("redirect_stdin")
def test_too_many_positionals(self):
"""
test bad commands
"""
with self.assertRaises(CommandLineError) as cm:
cline = "fb foo/bar file:///target_url extra".split()
cli_main.process_command_line(cline)
with self.assertRaises(CommandLineError) as cm:
cline = "rb file:///target_url foo/bar extra".split()
cli_main.process_command_line(cline)
with self.assertRaises(CommandLineError) as cm:
cline = "foo/bar file:///target_url extra".split()
cli_main.process_command_line(cline)
with self.assertRaises(CommandLineError) as cm:
cline = "file:///target_url foo/bar extra".split()
cli_main.process_command_line(cline)
@pytest.mark.usefixtures("redirect_stdin")
def test_list_commands(self):
"""
test list commands like ssh_options, etc.
"""
cline = shlex.split("inc foo/bar file:///target_url --ssh-options='--foo'")
cli_main.process_command_line(cline)
self.assertEqual(config.ssh_options, "--foo")
cline = shlex.split("inc foo/bar file:///target_url --ssh-options='--foo' --ssh-options='--bar'")
cli_main.process_command_line(cline)
self.assertEqual(config.ssh_options, "--foo --bar")
cline = shlex.split("inc foo/bar file:///target_url --ssh-options='--foo --bar'")
cli_main.process_command_line(cline)
self.assertEqual(config.ssh_options, "--foo --bar")
@pytest.mark.usefixtures("redirect_stdin")
def test_help_commands(self):
"""
Test -h/--help
"""
with self.assertRaises(SystemExit) as cm:
cli_main.process_command_line(shlex.split("-h"))
self.assertTrue(check_main_help(cm.content))
with self.assertRaises(SystemExit) as cm:
cli_main.process_command_line(shlex.split(f"--help"))
self.assertTrue(check_main_help(cm.content))
for cmd in [var2cmd(v) for v in DuplicityCommands.__dict__.keys() if not v.startswith("__")]:
with self.assertRaises(SystemExit) as cm:
cli_main.process_command_line(shlex.split(f"{cmd} -h"))
with self.assertRaises(SystemExit) as cm:
cli_main.process_command_line(shlex.split(f"{cmd} --help"))
@pytest.mark.usefixtures("redirect_stdin")
def test_log_options(self):
"""
test log options.
"""
log.setup()
# TODO: this fails although running duplicity, cli_main return the correct default loglevel
# default level is notice
# self.assertEqual(log.getverbosity(), log.NOTICE)
# setting custom level
cline = shlex.split("foo/bar file:///target_url --verbosity Debug")
cli_main.process_command_line(cline)
self.assertEqual(log.getverbosity(), log.DEBUG)
@pytest.mark.usefixtures("redirect_stdin")
def test_changed_removed(self):
"""
test changed/removed in odd places.
"""
# removed option with command
with self.assertRaises(cli_main.CommandLineError) as cm:
cline = shlex.split("--gio backup foo/bar file:///target_url")
cli_main.process_command_line(cline)
# removed option without command
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("--gio foo/bar file:///target_url")
cli_main.process_command_line(cline)
# changed option with command
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("restore --file-to-restore foo/bar file://source_url path")
cli_main.process_command_line(cline)
# changed option without command
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("--file-to-restore foo/bar file://source_url path")
cli_main.process_command_line(cline)
# removed backup option with command
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("--time-separator _ backup source_dir file://target_url")
cli_main.process_command_line(cline)
# removed backup option without command
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("--time-separator _ source_dir file://target_url")
cli_main.process_command_line(cline)
@pytest.mark.usefixtures("redirect_stdin")
def test_intermixed_args(self):
"""
test intermixed args.
"""
# Issue 766 -- intermixed -- explicit
cline = shlex.split(
f"--archive-dir {_runtest_dir}/backup-metadata/archive/ --tempdir {_runtest_dir}/backup-metadata/temp/ "
f"--allow-source-mismatch --encrypt-sign-key DEADDEAD --volsize 4096 --progress -v 4 "
f"incr --full-if-older-than 30D foo/bar --log-file {_runtest_dir}/log.txt boto3+s3://foo"
)
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.allow_source_mismatch, True)
self.assertEqual(config.archive_dir, f"{_runtest_dir}/backup-metadata/archive/".encode())
self.assertEqual(config.full_if_older_than, 2592000)
self.assertEqual(config.progress, True)
self.assertEqual(config.temproot, f"{_runtest_dir}/backup-metadata/temp/".encode())
self.assertEqual(config.volsize, 4294967296)
# Issue 766 -- intermixed -- implicit
cline = shlex.split(
f"--archive-dir {_runtest_dir}/backup-metadata/archive/ --tempdir {_runtest_dir}/backup-metadata/temp/ "
f"--allow-source-mismatch --encrypt-sign-key DEADDEAD --volsize 4096 --progress -v 4 "
f"--full-if-older-than 30D foo/bar --log-file {_runtest_dir}/log.txt boto3+s3://foo"
)
cli_main.process_command_line(cline)
self.assertEqual(config.action, "inc")
self.assertEqual(config.allow_source_mismatch, True)
self.assertEqual(config.archive_dir, f"{_runtest_dir}/backup-metadata/archive/".encode())
self.assertEqual(config.full_if_older_than, 2592000)
self.assertEqual(config.progress, True)
self.assertEqual(config.temproot, f"{_runtest_dir}/backup-metadata/temp/".encode())
self.assertEqual(config.volsize, 4294967296)
@pytest.mark.usefixtures("redirect_stdin")
def test_regression_issues(self):
"""
test regression issues.
"""
# Issue 759 - --asynchronous-upload
cline = shlex.split("backup --asynchronous-upload / file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.async_concurrency, 1)
# Issue 764 - --full-if-older-than -- explicit
cline = shlex.split("backup --full-if-older-than 30D foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, 2592000)
# Issue 764 - --full-if-older-than -- implied
cline = shlex.split("--full-if-older-than 30D foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, 2592000)
# Issue 773 - --exclude-device-files
config.select_opts = []
cline = shlex.split("backup --exclude-device-files / file://target_url")
cli_main.process_command_line(cline)
self.assertListEqual(config.select_opts, [("--exclude-device-files", [])])
# Issue 773 - --exclude-other-fileystems
config.select_opts = []
cline = shlex.split("backup --exclude-other-filesystems / file://target_url")
cli_main.process_command_line(cline)
self.assertListEqual(config.select_opts, [("--exclude-other-filesystems", [])])
# Issue 795/816 - invalid option error using --gpg-options - unbound - argparse bug
with self.assertRaises(CommandLineError) as cm:
cline = shlex.split("backup --gpg-options '--homedir=/home/user' foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertIn("design error in argparse", cm.exception)
# Issue 795/816 - invalid option error using --gpg-options - bound
cline = shlex.split("backup --gpg-options='--homedir=/home/user' foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.gpg_options, "--homedir=/home/user")
# Issue 869 - accept time formats as well as intervals as arguments to --full-if-older-than
cline = shlex.split("backup --full-if-older-than now foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, 0)
cline = shlex.split("backup --full-if-older-than 1D foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, 86400)
dup_time.setcurtime()
cline = shlex.split("backup --full-if-older-than 2025-05-05T00:00:00Z foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, dup_time.curtime - 1746403200)
cline = shlex.split("backup --full-if-older-than 2025-05-05T00:00:00+00:00 foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, dup_time.curtime - 1746403200)
cline = shlex.split("backup --full-if-older-than 2025-05-05T00:00:00 foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, dup_time.curtime - 1746403200)
cline = shlex.split("backup --full-if-older-than 2025-05-05 foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, dup_time.curtime - 1746403200)
cline = shlex.split("backup --full-if-older-than 1746403200 foo/bar file://target_url")
cli_main.process_command_line(cline)
self.assertEqual(config.full_if_older_than, dup_time.curtime - 1746403200)
|