@@ -367,6 +367,24 @@ def test_append(self):
367
367
MyPath1+=(path)/my/path1
368
368
""" )
369
369
370
+ def test_append_multiple (self ):
371
+ myprofile = textwrap .dedent ("""
372
+ # define
373
+ MyVar1+=MyValue1
374
+ MyVar1+=MyValue2
375
+ MyPath1 +=(path)/my/path1
376
+ MyPath1 +=(path)/my/path2
377
+ """ )
378
+
379
+ env = ProfileEnvironment .loads (myprofile )
380
+ text = env .dumps ()
381
+ assert text == textwrap .dedent ("""\
382
+ MyVar1+=MyValue1
383
+ MyVar1+=MyValue2
384
+ MyPath1+=(path)/my/path1
385
+ MyPath1+=(path)/my/path2
386
+ """ )
387
+
370
388
def test_prepend (self ):
371
389
myprofile = textwrap .dedent ("""
372
390
# define
@@ -381,6 +399,24 @@ def test_prepend(self):
381
399
MyPath1=+(path)/my/path1
382
400
""" )
383
401
402
+ def test_prepend_multiple (self ):
403
+ myprofile = textwrap .dedent ("""
404
+ # define
405
+ MyVar1=+MyValue1
406
+ MyVar1=+MyValue2
407
+ MyPath1=+(path)/my/path1
408
+ MyPath1=+(path)/my/path2
409
+ """ )
410
+
411
+ env = ProfileEnvironment .loads (myprofile )
412
+ text = env .dumps ()
413
+ assert text == textwrap .dedent ("""\
414
+ MyVar1=+MyValue1
415
+ MyVar1=+MyValue2
416
+ MyPath1=+(path)/my/path1
417
+ MyPath1=+(path)/my/path2
418
+ """ )
419
+
384
420
def test_combined (self ):
385
421
myprofile = textwrap .dedent ("""
386
422
MyVar1=+MyValue11
@@ -398,22 +434,73 @@ def test_combined(self):
398
434
MyPath1+=(path)/my/path12
399
435
""" )
400
436
401
- def test_combined2 (self ):
437
+ def test_combined_multiple (self ):
438
+ myprofile = textwrap .dedent ("""
439
+ MyVar1=+MyValue11
440
+ MyVar1=+MyValue12
441
+ MyVar1+=MyValue13
442
+ MyVar1+=MyValue14
443
+ MyPath1=+(path)/my/path11
444
+ MyPath1=+(path)/my/path12
445
+ MyPath1+=(path)/my/path13
446
+ MyPath1+=(path)/my/path12
447
+ """ )
448
+
449
+ env = ProfileEnvironment .loads (myprofile )
450
+ text = env .dumps ()
451
+ assert text == textwrap .dedent ("""\
452
+ MyVar1=+MyValue11
453
+ MyVar1=+MyValue12
454
+ MyVar1+=MyValue13
455
+ MyVar1+=MyValue14
456
+ MyPath1=+(path)/my/path11
457
+ MyPath1=+(path)/my/path12
458
+ MyPath1+=(path)/my/path13
459
+ MyPath1+=(path)/my/path12
460
+ """ )
461
+
462
+ def test_combined_prepend_first (self ):
463
+ myprofile = textwrap .dedent ("""
464
+ MyVar1+=MyValue11
465
+ MyVar1=+MyValue12
466
+ MyPath1+=(path)/my/path11
467
+ MyPath1=+(path)/my/path12
468
+ """ )
469
+
470
+ env = ProfileEnvironment .loads (myprofile )
471
+ text = env .dumps ()
472
+ # NOTE: This is reversed order compared to origin, prepend always first
473
+ assert text == textwrap .dedent ("""\
474
+ MyVar1=+MyValue12
475
+ MyVar1+=MyValue11
476
+ MyPath1=+(path)/my/path12
477
+ MyPath1+=(path)/my/path11
478
+ """ )
479
+
480
+ def test_combined_prepend_first_multiple (self ):
402
481
myprofile = textwrap .dedent ("""
403
482
MyVar1+=MyValue11
404
483
MyVar1=+MyValue12
484
+ MyVar1+=MyValue13
485
+ MyVar1=+MyValue14
405
486
MyPath1+=(path)/my/path11
406
487
MyPath1=+(path)/my/path12
488
+ MyPath1+=(path)/my/path13
489
+ MyPath1=+(path)/my/path14
407
490
""" )
408
491
409
492
env = ProfileEnvironment .loads (myprofile )
410
493
text = env .dumps ()
411
494
# NOTE: This is reversed order compared to origin, prepend always first
412
495
assert text == textwrap .dedent ("""\
413
496
MyVar1=+MyValue12
497
+ MyVar1=+MyValue14
414
498
MyVar1+=MyValue11
499
+ MyVar1+=MyValue13
415
500
MyPath1=+(path)/my/path12
501
+ MyPath1=+(path)/my/path14
416
502
MyPath1+=(path)/my/path11
503
+ MyPath1+=(path)/my/path13
417
504
""" )
418
505
419
506
0 commit comments