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