Changeset 750 in tailor


Ignore:
Timestamp:
09/03/05 16:55:35 (8 years ago)
Author:
lele@…
Hash name:
20050903145535-97f81-cef160451cd21e0eeb249ca605359a958419e6dc
Message:

Load the svndump to test the parser from an external file

Location:
vcpx/tests
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tests/svndump.py

    r748 r750  
    1414    """Ensure the svndump parser does its job.""" 
    1515 
    16     SIMPLE_TEST = r"""SVN-fs-dump-format-version: 2 
     16    def setUp(self): 
     17        from os.path import join, split 
    1718 
    18 UUID: c285bdbe-b1ff-0310-9ce6-89454991beb6 
    19  
    20 Revision-number: 0 
    21 Prop-content-length: 56 
    22 Content-length: 56 
    23  
    24 K 8 
    25 svn:date 
    26 V 27 
    27 2005-09-01T08:36:44.518389Z 
    28 PROPS-END 
    29  
    30 Revision-number: 1 
    31 Prop-content-length: 113 
    32 Content-length: 113 
    33  
    34 K 7 
    35 svn:log 
    36 V 14 
    37 Initial import 
    38 K 10 
    39 svn:author 
    40 V 4 
    41 lele 
    42 K 8 
    43 svn:date 
    44 V 27 
    45 2005-09-01T08:38:41.788715Z 
    46 PROPS-END 
    47  
    48 Node-path: bash.bashrc 
    49 Node-kind: file 
    50 Node-action: add 
    51 Prop-content-length: 10 
    52 Text-content-length: 980 
    53 Text-content-md5: 56132976d5243ea699c3f974ee886b88 
    54 Content-length: 990 
    55  
    56 PROPS-END 
    57 1# System-wide .bashrc file for interactive bash(1) shells. 
    58  
    59 # To enable the settings / commands in this file for login shells as well, 
    60 # this file has to be sourced in /etc/profile. 
    61  
    62 # If not running interactively, don't do anything 
    63 [ -z "$PS1" ] && return 
    64  
    65 # check the window size after each command and, if necessary, 
    66 # update the values of LINES and COLUMNS. 
    67 shopt -s checkwinsize 
    68  
    69 # set variable identifying the chroot you work in (used in the prompt below) 
    70 if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then 
    71     debian_chroot=$(cat /etc/debian_chroot) 
    72 fi 
    73  
    74 # set a fancy prompt (non-color, overwrite the one in /etc/profile) 
    75 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 
    76  
    77 # If this is an xterm set the title to user@host:dir 
    78 case "$TERM" in 
    79 xterm*|rxvt*) 
    80     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' 
    81     ;; 
    82 *) 
    83     ;; 
    84 esac 
    85  
    86 # enable bash completion in interactive shells 
    87 if [ -f /etc/bash_completion ]; then 
    88     . /etc/bash_completion 
    89 fi 
    90  
    91  
    92 Revision-number: 2 
    93 Prop-content-length: 114 
    94 Content-length: 114 
    95  
    96 K 7 
    97 svn:log 
    98 V 15 
    99 Rename the file 
    100 K 10 
    101 svn:author 
    102 V 4 
    103 lele 
    104 K 8 
    105 svn:date 
    106 V 27 
    107 2005-09-01T08:39:34.777407Z 
    108 PROPS-END 
    109  
    110 Node-path: bashrc 
    111 Node-kind: file 
    112 Node-action: add 
    113 Node-copyfrom-rev: 1 
    114 Node-copyfrom-path: bash.bashrc 
    115  
    116  
    117 Node-path: bash.bashrc 
    118 Node-action: delete 
    119  
    120  
    121 Revision-number: 3 
    122 Prop-content-length: 109 
    123 Content-length: 109 
    124  
    125 K 7 
    126 svn:log 
    127 V 10 
    128 Add subdir 
    129 K 10 
    130 svn:author 
    131 V 4 
    132 lele 
    133 K 8 
    134 svn:date 
    135 V 27 
    136 2005-09-01T08:42:42.256576Z 
    137 PROPS-END 
    138  
    139 Node-path: subdir 
    140 Node-kind: dir 
    141 Node-action: add 
    142 Prop-content-length: 10 
    143 Content-length: 10 
    144  
    145 PROPS-END 
    146  
    147  
    148 Node-path: subdir/other.version 
    149 Node-kind: file 
    150 Node-action: add 
    151 Node-copyfrom-rev: 2 
    152 Node-copyfrom-path: bashrc 
    153  
    154  
    155 Revision-number: 4 
    156 Prop-content-length: 112 
    157 Content-length: 112 
    158  
    159 K 7 
    160 svn:log 
    161 V 13 
    162 Rename subdir 
    163 K 10 
    164 svn:author 
    165 V 4 
    166 lele 
    167 K 8 
    168 svn:date 
    169 V 27 
    170 2005-09-01T08:43:11.241298Z 
    171 PROPS-END 
    172  
    173 Node-path: somethingelse 
    174 Node-kind: dir 
    175 Node-action: add 
    176 Node-copyfrom-rev: 3 
    177 Node-copyfrom-path: subdir 
    178  
    179  
    180 Node-path: subdir 
    181 Node-action: delete 
    182  
    183  
    184 Revision-number: 5 
    185 Prop-content-length: 114 
    186 Content-length: 114 
    187  
    188 K 7 
    189 svn:log 
    190 V 15 
    191 Rename and edit 
    192 K 10 
    193 svn:author 
    194 V 4 
    195 lele 
    196 K 8 
    197 svn:date 
    198 V 27 
    199 2005-09-01T08:44:11.867933Z 
    200 PROPS-END 
    201  
    202 Node-path: bash.profile 
    203 Node-kind: file 
    204 Node-action: add 
    205 Node-copyfrom-rev: 2 
    206 Node-copyfrom-path: bashrc 
    207 Text-content-length: 60 
    208 Text-content-md5: b91bd7d6d6fbd61901f9588511b49ec4 
    209 Content-length: 60 
    210  
    211 # System-wide .bashrc file for interactive bash(1) shells. 
    212  
    213  
    214  
    215 Node-path: bashrc 
    216 Node-action: delete 
    217  
    218  
    219 """ 
     19        datadir = join(split(__file__)[0], 'data') 
     20        self.log = open(join(datadir, 'simple.svndump'), 'rU') 
    22021 
    22122    def testBasicBehaviour(self): 
    22223        "Verify basic svndump parser behaviour" 
    22324 
    224         log = StringIO(self.SIMPLE_TEST) 
    225         csets = changesets_from_svndump(log) 
     25        csets = changesets_from_svndump(self.log) 
    22626 
    22727        self.assertEqual(len(csets), 5) 
     
    25757        "Verify how svndump parser filters entries" 
    25858 
    259         log = StringIO(self.SIMPLE_TEST) 
    260         csets = changesets_from_svndump(log, module="subdir") 
     59        csets = changesets_from_svndump(self.log, module="subdir") 
    26160 
    26261        self.assertEqual(len(csets), 2) 
Note: See TracChangeset for help on using the changeset viewer.