[Git][reproducible-builds/diffoscope][master] 3 commits: Use assert_diff in tests/comparators/test_rdata.py.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Tue Sep 14 14:38:35 UTC 2021



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
d12af4cc by Chris Lamb at 2021-09-14T11:31:45+01:00
Use assert_diff in tests/comparators/test_rdata.py.

- - - - -
ac1bcb6a by Chris Lamb at 2021-09-14T15:37:02+01:00
Support a newer format version of R .rds files.

- - - - -
622d1cac by Chris Lamb at 2021-09-14T15:37:02+01:00
Fix (and test) the comparison of R's .rdb files after refactoring of temporary directory handling.

This was a regression introduced in 1ee33f4e72e6 -- what was happening was
that the two files to be compared were copied to a temporary directory,
overwriting each other. This commit ensures they do not collide.

Signed-off-by: Chris Lamb <lamby at debian.org>

- - - - -


10 changed files:

- diffoscope/comparators/rdata.py
- tests/comparators/test_rdata.py
- + tests/data/rdb_expected_diff
- tests/data/rds_expected_diff
- + tests/data/test1.rdb
- tests/data/test1.rdx
- + tests/data/test2.rdb
- tests/data/test2.rdx
- tests/test_source.py
- tests/utils/data.py


Changes:

=====================================
diffoscope/comparators/rdata.py
=====================================
@@ -33,6 +33,7 @@ import binascii
 RDS_HEADERS = {
     binascii.a2b_hex("580a000000020003"),
     binascii.a2b_hex("580a000000030003"),
+    binascii.a2b_hex("580a000000030004"),
 }
 
 DUMP_RDB = rb"""
@@ -73,7 +74,7 @@ def check_rds_extension(f):
     return f.name.endswith(".rds") or f.name.endswith(".rdx")
 
 
-def get_module_path_for_rdb(rdb, temp_dir):
+def get_module_path_for_rdb(rdb, temp_dir, module_name):
     """
     R's lazyLoad method does not take a filename directly to an .rdb file (eg.
     `/path/to/foo.rdb`) but rather the path without any extension (eg.
@@ -106,7 +107,7 @@ def get_module_path_for_rdb(rdb, temp_dir):
         # Corresponding .rdx does not exist
         return None
 
-    prefix = os.path.join(temp_dir, "temp")
+    prefix = os.path.join(temp_dir, module_name)
 
     logger.debug("Copying %s and %s to %s", rdx.path, rdb.path, temp_dir)
     shutil.copy(rdb.path, f"{prefix}.rdb")
@@ -162,8 +163,8 @@ class RdbFile(File):
 
     def compare_details(self, other, source=None):
         with get_temporary_directory(suffix="rdb") as tmpdir:
-            a = get_module_path_for_rdb(self, tmpdir)
-            b = get_module_path_for_rdb(other, tmpdir)
+            a = get_module_path_for_rdb(self, tmpdir, "a")
+            b = get_module_path_for_rdb(other, tmpdir, "b")
 
             if a is None or b is None:
                 return []


=====================================
tests/comparators/test_rdata.py
=====================================
@@ -2,7 +2,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright © 2017 Ximin Luo <infinity0 at debian.org>
-# Copyright © 2017, 2020 Chris Lamb <lamby at debian.org>
+# Copyright © 2017, 2020-2021 Chris Lamb <lamby at debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,37 +20,56 @@
 import pytest
 
 from diffoscope.comparators.gzip import GzipFile
+from diffoscope.comparators.rdata import RdbFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, get_data, assert_diff
 from ..utils.tools import skip_unless_tools_exist
 
 
-file1 = load_fixture("test1.rdx")
-file2 = load_fixture("test2.rdx")
+rdb1 = load_fixture("test1.rdb")
+rdb2 = load_fixture("test2.rdb")
+rdx1 = load_fixture("test1.rdx")
+rdx2 = load_fixture("test2.rdx")
 
 
-def test_identification(file1):
-    assert isinstance(file1, GzipFile)
+def test_identification(rdb1, rdx1):
+    assert isinstance(rdb1, RdbFile)
+    assert isinstance(rdx1, GzipFile)
 
 
-def test_no_differences(file1):
-    difference = file1.compare(file1)
-    assert difference is None
+def test_no_differences(rdb1, rdx1):
+    assert rdx1.compare(rdx1) is None
+    assert rdx1.compare(rdx1) is None
 
 
 @pytest.fixture
-def differences(file1, file2):
-    return file1.compare(file2).details
+def differences_rdb(rdb1, rdb2):
+    return rdb1.compare(rdb2).details
+
+
+ at pytest.fixture
+def differences_rdx(rdx1, rdx2):
+    return rdx1.compare(rdx2).details
+
+
+ at skip_unless_tools_exist("Rscript")
+def test_num_items_rdb(differences_rdb):
+    assert len(differences_rdb) == 1
+
+
+ at skip_unless_tools_exist("Rscript")
+def test_item_rdb(differences_rdb):
+    assert differences_rdb[0].source1.startswith("Rscript")
+    assert_diff(differences_rdb[0], "rdb_expected_diff")
 
 
 @skip_unless_tools_exist("Rscript")
-def test_num_items(differences):
-    assert len(differences) == 1
+def test_num_items_rdx(differences_rdx):
+    assert len(differences_rdx) == 1
 
 
 @skip_unless_tools_exist("Rscript")
-def test_item_rds(differences):
-    assert differences[0].source1 == "test1.rdx-content"
-    assert differences[0].source2 == "test2.rdx-content"
-    expected_diff = get_data("rds_expected_diff")
-    assert differences[0].details[0].unified_diff == expected_diff
+def test_item_rdx(differences_rdx):
+    assert differences_rdx[0].source1 == "test1.rdx-content"
+    assert differences_rdx[0].source2 == "test2.rdx-content"
+    assert_diff(differences_rdx[0].details[0], "rds_expected_diff")


=====================================
tests/data/rdb_expected_diff
=====================================
The diff for this file was not included because it is too large.

=====================================
tests/data/rds_expected_diff
=====================================
@@ -1,50 +1,955 @@
-@@ -1,40 +1,40 @@
+@@ -1,715 +1,367 @@
  $variables
- $variables$`%*t%`
--[1]  0 98
-+[1]  0 96
+-$variables$`%c%.matrix`
+-[1]   0 561
++$variables$.__C__Biodetection
++[1]   0 286
  
- $variables$`%t*%`
--[1]  98 101
-+[1] 96 99
+-$variables$.__NAMESPACE__.
+-[1] 7547   62
+-
+-$variables$.__S3MethodsTable__.
+-[1] 7749   62
+-
+-$variables$.onAttach
+-[1] 7811  820
+-
+-$variables$.onLoad
+-[1] 8631  299
+-
+-$variables$.packageName
+-[1] 8930   57
+-
+-$variables$add.isolates
+-[1] 8987  671
+-
+-$variables$as.edgelist.sna
+-[1] 9658 8752
+-
+-$variables$as.sociomatrix.sna
+-[1] 18410  6439
+-
+-$variables$bbnam
+-[1] 24849   477
+-
+-$variables$bbnam.actor
+-[1] 25326  9516
+-
+-$variables$bbnam.bf
+-[1] 34842  4990
+-
+-$variables$bbnam.fixed
+-[1] 39832  3960
+-
+-$variables$bbnam.jntlik
+-[1] 43792   547
+-
+-$variables$bbnam.jntlik.slice
+-[1] 44339  1004
+-
+-$variables$bbnam.pooled
+-[1] 45343  8158
+-
+-$variables$bbnam.probtie
+-[1] 53501   773
+-
+-$variables$betweenness
+-[1] 54274  3346
+-
+-$variables$bicomponent.dist
+-[1] 57620  2903
+-
+-$variables$blockmodel
+-[1] 60523  6614
+-
+-$variables$blockmodel.expand
+-[1] 67137  2219
+-
+-$variables$bn
+-[1] 69356  8637
+-
+-$variables$bn.nlpl.dyad
+-[1] 77993  1013
+-
+-$variables$bn.nlpl.edge
+-[1] 79006  1634
+-
+-$variables$bn.nlpl.triad
+-[1] 80640  1057
+-
+-$variables$bn.nltl
+-[1] 81697  1000
+-
+-$variables$bonpow
+-[1] 82697  2354
+-
+-$variables$brokerage
+-[1] 85051 10585
+-
+-$variables$centralgraph
+-[1] 95636  1012
+-
+-$variables$centralization
+-[1] 96648  1203
+-
+-$variables$clique.census
+-[1] 97851  3663
+-
+-$variables$closeness
+-[1] 101514   3153
+-
+-$variables$coef.bn
+-[1] 104667    485
+-
+-$variables$coef.lnam
+-[1] 105152    649
+-
+-$variables$component.dist
+-[1] 105801   2769
+-
+-$variables$component.largest
+-[1] 108570   2435
+-
+-$variables$component.size.byvertex
+-[1] 111005   1417
+-
+-$variables$components
+-[1] 112422    718
+-
+-$variables$connectedness
+-[1] 113140   1125
+-
+-$variables$consensus
+-[1] 114265   7392
+-
+-$variables$cug.test
+-[1] 121657   5668
+-
+-$variables$cugtest
+-[1] 127325   3096
+-
+-$variables$cutpoints
+-[1] 130421   2064
+-
+-$variables$degree
+-[1] 132485   2216
+-
+-$variables$diag.remove
+-[1] 134701    901
+-
+-$variables$dyad.census
+-[1] 135602   2866
+-
+-$variables$efficiency
+-[1] 138468   1764
+-
+-$variables$ego.extract
+-[1] 140232   2112
+-
+-$variables$equiv.clust
+-[1] 142344   2171
+-
+-$variables$eval.edgeperturbation
+-[1] 144515    616
+-
+-$variables$evcent
+-[1] 145131   2319
+-
+-$variables$event2dichot
+-[1] 147450   3694
+-
+-$variables$flowbet
+-[1] 151144   4376
+-
+-$variables$gapply
+-[1] 155520   2422
+-
+-$variables$gclust.boxstats
+-[1] 157942   1099
+-
+-$variables$gclust.centralgraph
+-[1] 159041   1357
+-
+-$variables$gcor
+-[1] 160398   3693
+-
+-$variables$gcov
+-[1] 164091   3694
+-
+-$variables$gden
+-[1] 167785   2194
+-
+-$variables$gdist.plotdiff
+-[1] 169979    816
+-
+-$variables$gdist.plotstats
+-[1] 170795   4487
+-
+-$variables$geodist
+-[1] 175282   2175
+-
+-$variables$gilschmidt
+-[1] 177457   1429
+-
+-$variables$gliop
+-[1] 178886   1002
+-
+-$variables$gplot
+-[1] 179888  22817
++$variables$.__C__CD
++[1] 286 283
  
- $variables$`%t*t%`
--[1] 199 104
-+[1] 195 103
+-$variables$gplot.arrow
+-[1] 202705   9429
++$variables$.__C__CountsBio
++[1] 569 288
  
- $variables$.__NAMESPACE__.
--[1] 877  45
-+[1] 854  43
+-$variables$gplot.layout.adj
+-[1] 212134    599
++$variables$.__C__GCbias
++[1] 857 286
  
- $variables$.__S3MethodsTable__.
--[1] 1043   45
-+[1] 1016   43
+-$variables$gplot.layout.circle
+-[1] 212733    735
++$variables$.__C__Output
++[1] 1143 2240
  
- $variables$.packageName
--[1] 1088   44
-+[1] 1059   42
+-$variables$gplot.layout.circrand
+-[1] 213468    459
++$variables$.__C__PCA
++[1] 3383  284
  
- $variables$tensor
--[1] 1132  775
-+[1] 1101  774
+-$variables$gplot.layout.eigen
+-[1] 213927   1512
++$variables$.__C__Saturation
++[1] 3667  285
  
+-$variables$gplot.layout.fruchtermanreingold
+-[1] 215439   2906
++$variables$.__C__lengthbias
++[1] 3952  288
  
- $references
- $references$`env::1`
--[1] 572 305
-+[1] 564 290
+-$variables$gplot.layout.geodist
+-[1] 218345    597
++$variables$.__C__myInfo
++[1] 4240 1158
  
- $references$`env::2`
--[1] 303 121
-+[1] 298 119
+-$variables$gplot.layout.hall
+-[1] 218942    866
+-
+-$variables$gplot.layout.kamadakawai
+-[1] 219808   2573
+-
+-$variables$gplot.layout.mds
+-[1] 222381   1663
+-
+-$variables$gplot.layout.princoord
+-[1] 224044   1500
+-
+-$variables$gplot.layout.random
+-[1] 225544   1322
+-
+-$variables$gplot.layout.rmds
+-[1] 226866    601
+-
+-$variables$gplot.layout.segeo
+-[1] 227467    540
+-
+-$variables$gplot.layout.seham
+-[1] 228007    605
+-
+-$variables$gplot.layout.spring
+-[1] 228612   4757
+-
+-$variables$gplot.layout.springrepulse
+-[1] 233369    463
+-
+-$variables$gplot.layout.target
+-[1] 233832   3612
+-
+-$variables$gplot.loop
+-[1] 237444   4659
+-
+-$variables$gplot.target
+-[1] 242103   3484
+-
+-$variables$gplot.vertex
+-[1] 245587   1623
+-
+-$variables$gplot3d
+-[1] 247210   8292
+-
+-$variables$gplot3d.arrow
+-[1] 255502   3709
+-
+-$variables$gplot3d.layout.adj
+-[1] 259211    601
+-
+-$variables$gplot3d.layout.eigen
+-[1] 259812   1512
+-
+-$variables$gplot3d.layout.fruchtermanreingold
+-[1] 261324   2263
+-
+-$variables$gplot3d.layout.geodist
+-[1] 263587    599
+-
+-$variables$gplot3d.layout.hall
+-[1] 264186    863
+-
+-$variables$gplot3d.layout.kamadakawai
+-[1] 265049   2679
+-
+-$variables$gplot3d.layout.mds
+-[1] 267728   1675
+-
+-$variables$gplot3d.layout.princoord
+-[1] 269403   1569
+-
+-$variables$gplot3d.layout.random
+-[1] 270972   1474
+-
+-$variables$gplot3d.layout.rmds
+-[1] 272446    603
+-
+-$variables$gplot3d.layout.segeo
+-[1] 273049    542
+-
+-$variables$gplot3d.layout.seham
+-[1] 273591    607
+-
+-$variables$gplot3d.loop
+-[1] 274198   3031
+-
+-$variables$graphcent
+-[1] 277229   1811
+-
+-$variables$grecip
+-[1] 279040   4960
+-
+-$variables$gscor
+-[1] 284000   6036
+-
+-$variables$gscov
+-[1] 290036   6037
+-
+-$variables$gt
+-[1] 296073   1256
+-
+-$variables$gtrans
+-[1] 297329   6741
+-
+-$variables$gvectorize
+-[1] 304070   2237
+-
+-$variables$hdist
+-[1] 306307   3865
+-
+-$variables$hierarchy
+-[1] 310172   1696
+-
+-$variables$infocent
+-[1] 311868   3259
+-
+-$variables$interval.graph
+-[1] 315127   2420
+-
+-$variables$is.connected
+-[1] 317547    549
+-
+-$variables$is.edgelist.sna
+-[1] 318096    827
+-
+-$variables$is.isolate
+-[1] 318923   1029
+-
+-$variables$isolates
+-[1] 319952    926
+-
+-$variables$kcores
+-[1] 320878   1770
+-
+-$variables$kcycle.census
+-[1] 322648   3209
+-
+-$variables$kpath.census
+-[1] 325857   3929
+-
+-$variables$lab.optimize
+-[1] 329786   1025
+-
+-$variables$lab.optimize.anneal
+-[1] 330811   5809
+-
+-$variables$lab.optimize.exhaustive
+-[1] 336620   2468
+-
+-$variables$lab.optimize.gumbel
+-[1] 339088   3227
+-
+-$variables$lab.optimize.hillclimb
+-[1] 342315   3891
+-
+-$variables$lab.optimize.mc
+-[1] 346206   2276
+-
+-$variables$lnam
+-[1] 348482  18248
++$variables$.__NAMESPACE__.
++[1] 12405    62
  
- $references$`env::3`
--[1] 424 148
-+[1] 417 147
+-$variables$loadcent
+-[1] 366730   2278
++$variables$.__S3MethodsTable__.
++[1] 12607    62
  
- $references$`env::4`
--[1] 922 121
-+[1] 897 119
+-$variables$logMean
+-[1] 369008    555
++$variables$`.__T__dat2save:NOISeq`
++[1] 18038    62
+ 
+-$variables$logSub
+-[1] 369563    685
++$variables$`.__T__explo.plot:NOISeq`
++[1] 21700    62
+ 
+-$variables$logSum
+-[1] 370248    518
++$variables$`.__T__show:methods`
++[1] 185265     63
+ 
+-$variables$lower.tri.remove
+-[1] 370766   1043
++$variables$.calcFactorQuantile
++[1] 185328    643
+ 
+-$variables$lubness
+-[1] 371809   2301
++$variables$.calcFactorWeighted
++[1] 185971   2087
+ 
+-$variables$make.stochastic
+-[1] 374110   4837
++$variables$.calcNormFactors
++[1] 188058   1215
+ 
+-$variables$maxflow
+-[1] 378947   2646
++$variables$.packageName
++[1] 189273     60
+ 
+-$variables$mutuality
+-[1] 381593    544
++$variables$ARSyNcomponents
++[1] 189333   1768
+ 
+-$variables$nacf
+-[1] 382137   3061
++$variables$ARSyNmodel
++[1] 191101   2635
+ 
+-$variables$neighborhood
+-[1] 385198   2139
++$variables$ARSyNseq
++[1] 193736   2972
+ 
+-$variables$netcancor
+-[1] 387337   6916
++$variables$ASCA.1f
++[1] 196708   2220
+ 
+-$variables$netlm
+-[1] 394253  11714
++$variables$ASCA.2f
++[1] 198928   2743
+ 
+-$variables$netlogit
+-[1] 405967  12672
++$variables$ASCA.3f
++[1] 201671   3688
+ 
+-$variables$npostpred
+-[1] 418639    416
++$variables$ASCAfun.res
++[1] 205359   1279
+ 
+-$variables$nties
+-[1] 419055   1235
++$variables$ASCAfun.triple
++[1] 206638   5571
+ 
+-$variables$numperm
+-[1] 420290   1333
++$variables$ASCAfun1
++[1] 212209   2782
+ 
+-$variables$plot.bbnam
+-[1] 421623    234
++$variables$ASCAfun12
++[1] 214991   3631
+ 
+-$variables$plot.bbnam.actor
+-[1] 421857   3064
++$variables$ASCAfun2
++[1] 218622   4050
+ 
+-$variables$plot.bbnam.fixed
+-[1] 424921    728
++$variables$CV
++[1] 222672    345
+ 
+-$variables$plot.bbnam.pooled
+-[1] 425649   1927
++$variables$DE.plot
++[1] 223017  16368
+ 
+-$variables$plot.blockmodel
+-[1] 427576   1990
++$variables$GC.dat
++[1] 239385   7931
+ 
+-$variables$plot.bn
+-[1] 429566   3658
++$variables$GC.plot
++[1] 247316   3588
+ 
+-$variables$plot.cug.test
+-[1] 433224    731
++$variables$MD
++[1] 250904   1285
+ 
+-$variables$plot.cugtest
+-[1] 433955    652
++$variables$MD.plot
++[1] 252189    768
+ 
+-$variables$plot.equiv.clust
+-[1] 434607    413
++$variables$MDbio
++[1] 252957   2281
+ 
+-$variables$plot.lnam
+-[1] 435020   3655
++$variables$Output
++[1] 255238    462
+ 
+-$variables$plot.qaptest
+-[1] 438675    651
++$variables$PCA.GENES
++[1] 255700   1649
+ 
+-$variables$plot.sociomatrix
+-[1] 439326   3263
++$variables$PCA.dat
++[1] 257349   1115
+ 
+-$variables$potscalered.mcmc
+-[1] 442589    954
++$variables$PCA.plot
++[1] 258464   3098
+ 
+-$variables$prestige
+-[1] 443543   4447
++$variables$QCreport
++[1] 261562  15013
+ 
+-$variables$print.bayes.factor
+-[1] 447990    616
++$variables$addData
++[1] 276575   5787
+ 
+-$variables$print.bbnam
+-[1] 448606    201
++$variables$allMD
++[1] 282362  10266
+ 
+-$variables$print.bbnam.actor
+-[1] 448807   2023
++$variables$allMDbio
++[1] 292628   8960
+ 
+-$variables$print.bbnam.fixed
+-[1] 450830    866
++$variables$biodetection.dat
++[1] 301588   3499
+ 
+-$variables$print.bbnam.pooled
+-[1] 451696   2021
++$variables$biodetection.plot
++[1] 305087   7985
+ 
+-$variables$print.blockmodel
+-[1] 453717   1587
++$variables$busca
++[1] 313072    426
+ 
+-$variables$print.bn
+-[1] 455304    872
++$variables$cd.dat
++[1] 313498   4515
+ 
+-$variables$print.cug.test
+-[1] 456176    644
++$variables$cd.plot
++[1] 318013   2357
+ 
+-$variables$print.cugtest
+-[1] 456820    449
++$variables$countsbio.dat
++[1] 320370   7361
+ 
+-$variables$print.equiv.clust
+-[1] 457269    595
++$variables$countsbio.plot
++[1] 327731   6156
+ 
+-$variables$print.lnam
+-[1] 457864    642
++$variables$dat
++[1] 333887   1421
+ 
+-$variables$print.netcancor
+-[1] 458506   1870
++$variables$dat2save
++[1] 335308    401
+ 
+-$variables$print.netlm
+-[1] 460376   2741
++$variables$data2report
++[1] 335709   1640
+ 
+-$variables$print.netlogit
+-[1] 463117   2134
++$variables$degenes
++[1] 337349   2298
+ 
+-$variables$print.qaptest
+-[1] 465251    448
++$variables$explo.plot
++[1] 339647    416
+ 
+-$variables$print.summary.bayes.factor
+-[1] 465699   1556
++$variables$filtered.data
++[1] 340063   3504
+ 
+-$variables$print.summary.bbnam
+-[1] 467255    201
++$variables$int.mult
++[1] 343567    578
+ 
+-$variables$print.summary.bbnam.actor
+-[1] 467456   4015
++$variables$length.dat
++[1] 344145   7935
+ 
+-$variables$print.summary.bbnam.fixed
+-[1] 471471   1021
++$variables$length.plot
++[1] 352080   3549
+ 
+-$variables$print.summary.bbnam.pooled
+-[1] 472492   2859
++$variables$logscaling
++[1] 355629    704
+ 
+-$variables$print.summary.blockmodel
+-[1] 475351   2447
++$variables$make.ASCA.design
++[1] 356333    979
+ 
+-$variables$print.summary.bn
+-[1] 477798   3220
++$variables$miscolores
++[1] 357312    168
+ 
+-$variables$print.summary.brokerage
+-[1] 481018   1398
++$variables$myDfunction
++[1] 357480    608
+ 
+-$variables$print.summary.cugtest
+-[1] 482416   1153
++$variables$mypretty
++[1] 358088   1244
+ 
+-$variables$print.summary.lnam
+-[1] 483569   4402
++$variables$n.menor
++[1] 359332    421
+ 
+-$variables$print.summary.netcancor
+-[1] 487971   3338
++$variables$noceros
++[1] 359753    456
+ 
+-$variables$print.summary.netlm
+-[1] 491309   4083
++$variables$noiseq
++[1] 360209   4099
+ 
+-$variables$print.summary.netlogit
+-[1] 495392   4160
++$variables$noiseqbio
++[1] 364308   6161
+ 
+-$variables$print.summary.qaptest
+-[1] 499552   1154
++$variables$plot.y2
++[1] 370469   2410
+ 
+-$variables$pstar
+-[1] 500706   8639
++$variables$probdeg
++[1] 372879   1399
+ 
+-$variables$qaptest
+-[1] 509345   1304
++$variables$ranking
++[1] 374278   1038
+ 
+-$variables$reachability
+-[1] 510649   2096
++$variables$readData
++[1] 375316   2539
+ 
+-$variables$read.dot
+-[1] 512745   1508
++$variables$rpkm
++[1] 377855   1016
+ 
+-$variables$read.nos
+-[1] 514253   1427
++$variables$saturation.dat
++[1] 378871   6983
+ 
+-$variables$redist
+-[1] 515680   5254
++$variables$saturation.plot
++[1] 385854   6714
+ 
+-$variables$rewire.ud
+-[1] 520934   1289
++$variables$share.info
++[1] 392568   5438
+ 
+-$variables$rewire.ws
+-[1] 522223   1345
++$variables$sim.samples
++[1] 398006   1485
+ 
+-$variables$rgbn
+-[1] 523568   3630
++$variables$sinceros
++[1] 399491    761
+ 
+-$variables$rgnm
+-[1] 527198   2754
++$variables$tmm
++[1] 400252   1494
+ 
+-$variables$rgnmix
+-[1] 529952   3644
++$variables$uqua
++[1] 401746   1700
+ 
+-$variables$rgraph
+-[1] 533596   3332
+ 
+-$variables$rguman
+-[1] 536928   2836
++$references
++$references$`env::1`
++[1] 5706 6699
+ 
+-$variables$rgws
+-[1] 539764   1749
++$references$`env::10`
++[1] 20320   270
+ 
+-$variables$rmperm
+-[1] 541513   1394
++$references$`env::11`
++[1] 18100  1110
+ 
+-$variables$rperm
+-[1] 542907    710
++$references$`env::12`
++[1] 19210  1110
+ 
+-$variables$sdmat
+-[1] 543617   1626
++$references$`env::13`
++[1] 181233   4032
+ 
+-$variables$se.lnam
+-[1] 545243    906
++$references$`env::14`
++[1] 180761    472
+ 
+-$variables$sedist
+-[1] 546149   4970
++$references$`env::15`
++[1] 139943  20409
+ 
+-$variables$simmelian
+-[1] 551119   1029
++$references$`env::16`
++[1] 21762   183
+ 
+-$variables$sociomatrixplot
+-[1] 552148   3263
++$references$`env::17`
++[1] 21945  1535
+ 
+-$variables$sr2css
+-[1] 555411    826
++$references$`env::18`
++[1] 137619   2324
+ 
+-$variables$stackcount
+-[1] 556237    356
++$references$`env::19`
++[1] 123123    152
+ 
+-$variables$stresscent
+-[1] 556593   2275
++$references$`env::2`
++[1] 5398  140
+ 
+-$variables$structdist
+-[1] 558868   5365
++$references$`env::20`
++[1] 117923   5200
+ 
+-$variables$structure.statistics
+-[1] 564233   1325
++$references$`env::21`
++[1] 117182    741
+ 
+-$variables$summary.bayes.factor
+-[1] 565558   1076
++$references$`env::22`
++[1] 32250   152
+ 
+-$variables$summary.bbnam
+-[1] 566634    379
++$references$`env::23`
++[1] 23480  8770
+ 
+-$variables$summary.bbnam.actor
+-[1] 567013    385
++$references$`env::24`
++[1] 112363   4819
+ 
+-$variables$summary.bbnam.fixed
+-[1] 567398    386
++$references$`env::25`
++[1] 39689 49420
+ 
+-$variables$summary.bbnam.pooled
+-[1] 567784    386
++$references$`env::26`
++[1] 36359   347
+ 
+-$variables$summary.blockmodel
+-[1] 568170    334
++$references$`env::27`
++[1] 33177  3182
+ 
+-$variables$summary.bn
+-[1] 568504    376
++$references$`env::28`
++[1] 32402   775
+ 
+-$variables$summary.brokerage
+-[1] 568880    304
++$references$`env::29`
++[1] 36706   875
+ 
+-$variables$summary.cugtest
+-[1] 569184    381
++$references$`env::3`
++[1] 5538  168
+ 
+-$variables$summary.lnam
+-[1] 569565    349
++$references$`env::30`
++[1] 37581  1787
+ 
+-$variables$summary.netcancor
+-[1] 569914    383
++$references$`env::31`
++[1] 39368   321
+ 
+-$variables$summary.netlm
+-[1] 570297    379
++$references$`env::32`
++[1] 89109 23254
+ 
+-$variables$summary.netlogit
+-[1] 570676    382
++$references$`env::33`
++[1] 129040   2484
+ 
+-$variables$summary.qaptest
+-[1] 571058    381
++$references$`env::34`
++[1] 128873    167
+ 
+-$variables$symmetrize
+-[1] 571439   4336
++$references$`env::35`
++[1] 123275   5598
+ 
+-$variables$triad.census
+-[1] 575775   1992
++$references$`env::36`
++[1] 137467    152
+ 
+-$variables$triad.classify
+-[1] 577767   1663
++$references$`env::37`
++[1] 132265   5202
+ 
+-$variables$upper.tri.remove
+-[1] 579430   1036
++$references$`env::38`
++[1] 131524    741
+ 
+-$variables$write.dl
+-[1] 580466   2744
++$references$`env::39`
++[1] 160352  20409
+ 
+-$variables$write.nos
+-[1] 583210   1860
++$references$`env::4`
++[1] 12467   140
+ 
++$references$`env::5`
++[1] 16338  1700
+ 
+-$references
+-$references$`env::1`
+-[1]  866 6681
++$references$`env::6`
++[1] 16069   269
+ 
+-$references$`env::2`
+-[1] 561 140
++$references$`env::7`
++[1] 12669  1700
+ 
+-$references$`env::3`
+-[1] 701 165
++$references$`env::8`
++[1] 14369  1700
+ 
+-$references$`env::4`
+-[1] 7609  140
++$references$`env::9`
++[1] 20590  1110
  
  
  $compressed


=====================================
tests/data/test1.rdb
=====================================
Binary files /dev/null and b/tests/data/test1.rdb differ


=====================================
tests/data/test1.rdx
=====================================
Binary files a/tests/data/test1.rdx and b/tests/data/test1.rdx differ


=====================================
tests/data/test2.rdb
=====================================
Binary files /dev/null and b/tests/data/test2.rdb differ


=====================================
tests/data/test2.rdx
=====================================
Binary files a/tests/data/test2.rdx and b/tests/data/test2.rdx differ


=====================================
tests/test_source.py
=====================================
@@ -130,6 +130,7 @@ ALLOWED_TEST_FILES = {
     "test1.png",
     "test1.ppu",
     "test1.ps",
+    "test1.rdb",
     "test1.rdx",
     "test1.rlib",
     "test1.rpm",
@@ -191,6 +192,7 @@ ALLOWED_TEST_FILES = {
     "test2.png",
     "test2.ppu",
     "test2.ps",
+    "test2.rdb",
     "test2.rdx",
     "test2.rlib",
     "test2.rpm",


=====================================
tests/utils/data.py
=====================================
@@ -24,6 +24,7 @@ import re
 import pytest
 
 from diffoscope.comparators.binary import FilesystemFile
+from diffoscope.comparators.directory import FilesystemDirectory
 from diffoscope.comparators.utils.specialize import specialize
 
 re_normalize_zeros = re.compile(
@@ -31,8 +32,17 @@ re_normalize_zeros = re.compile(
 )
 
 
+def init_file(filename):
+    # Ensure that any (specialized) FilesystemFile in tests have a
+    # corresponding Container for any comparator that needs to know which
+    # directory the file came from (eg. rdata)
+    container = FilesystemDirectory(os.path.dirname(filename)).as_container
+
+    return specialize(FilesystemFile(filename, container))
+
+
 def init_fixture(filename):
-    return pytest.fixture(lambda: specialize(FilesystemFile(filename)))
+    return pytest.fixture(lambda: init_file(filename))
 
 
 def data(filename):



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2fae7e85506f3fdff8f2117dd7a4c3340b7c47ef...622d1cac0ab65edfd217149ae20ce16f807dd658

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2fae7e85506f3fdff8f2117dd7a4c3340b7c47ef...622d1cac0ab65edfd217149ae20ce16f807dd658
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210914/99615b25/attachment.htm>


More information about the rb-commits mailing list