Public Member Functions | |
def | Compare |
def | get_prep |
def | dif_ |
def | __call__ |
def | assert_ |
def | __repr__ |
Static Public Attributes | |
tuple | Compare = classmethod(Compare) |
tuple | prep = property(get_prep) |
tuple | dif_ = classmethod( dif_ ) |
Compares directories contained cascade mysqldumps after first replacing the times from todays dates avoiding inevitable validity insert time differences Successful comparison Requires the *DbiTest* and *DybDbiTest* dumps to be created on the same UTC day.
Definition at line 264 of file dbcas.py.
def DybPython::dbcas::DD::Compare | ( | cls, | ||
cas, | ||||
dir, | ||||
cfdir, | ||||
reference = False | ||||
) |
def DybPython::dbcas::DD::get_prep | ( | self | ) |
Initially this just obscured the times in UTC todays date (which appears in the Vld table INSERTDATE column) to allow comparison between DbiTest and DybDbiTest runs done on the same UTC day However, now that are extending usage of the MYSQLDUMP reference comparisons to dumps of DBWriter created DB from different days, need to obscure todays date fully
Definition at line 281 of file dbcas.py.
00282 : 00283 if not con.ascii: 00284 dd = DD(dbno=dbno, dir=dir , cfdir=cfdir , reference=reference ) 00285 print dd.assert_() 00286 Compare = classmethod(Compare) 00287 00288 def get_prep(self): 00289 """ 00290 Initially this just obscured the times in UTC todays date 00291 (which appears in the Vld table INSERTDATE column) to 00292 allow comparison between DbiTest and DybDbiTest runs done on the same UTC day 00293 However, now that are extending usage of the MYSQLDUMP reference comparisons
def DybPython::dbcas::DD::dif_ | ( | cls, | ||
a, | ||||
b, | ||||
prep | ||||
) |
def DybPython::dbcas::DD::__call__ | ( | self | ) |
Definition at line 301 of file dbcas.py.
00303 : 00304 from difflib import unified_diff 00305 return unified_diff( map(prep,open(a).readlines()), map(prep,open(b).readlines()) , a, b ) 00306 dif_ = classmethod( dif_ ) 00307 00308 def __call__(self): 00309 ref = ".ref" if self['reference'] else "" 00310 a = os.path.join( self['dir'], "%s.sql" % self['dbno'] ) 00311 b = os.path.join( self['cfdir'], "%s.sql%s" % ( self['dbno'] , ref ) ) 00312 print "DD a", a 00313 print "DD b", b 00314 00315 assert os.path.exists(a) , a 00316 if self['reference']: 00317 if not os.path.exists(b): 00318 print "b %s does not exist, blessing a %s to reference " % ( b, a ) shutil.copyfile( a, b)
def DybPython::dbcas::DD::assert_ | ( | self | ) |
def DybPython::dbcas::DD::__repr__ | ( | self | ) |
tuple DybPython::dbcas::DD::Compare = classmethod(Compare) [static] |
tuple DybPython::dbcas::DD::prep = property(get_prep) [static] |
tuple DybPython::dbcas::DD::dif_ = classmethod( dif_ ) [static] |