#NEWLINE# def testNodesTable( self ) : #NEWLINE# #INDENT# db = self . getDB ( ) #NEWLINE# schema . createSchema ( db ) #NEWLINE# b = versionops . BranchTable ( db ) #NEWLINE# v = versiontable . VersionTable ( db ) #NEWLINE# i = items . Items ( db ) #NEWLINE# sv = versionops . SqlVersioning ( db , v , b ) #NEWLINE# ver = ThawVersion ( '/a.b.c@d:e/1:1-1-1' ) #NEWLINE# itemId = i . getOrAddId ( 'foo' ) #NEWLINE# ( nodeId , versionId ) = sv . createVersion ( itemId , ver , 0 , None ) #NEWLINE# cu = db . cursor ( ) #NEWLINE# cu . execute ( 'select sourceItemId from Nodes where nodeId = ?' , nodeId ) #NEWLINE# self . assertEqual ( cu . fetchall ( ) [ 0 ] [ 0 ] , None ) #NEWLINE# srcId = i . getOrAddId ( 'foo:source' ) #NEWLINE# sv . nodes . updateSourceItemId ( nodeId , srcId ) #NEWLINE# cu . execute ( 'select sourceItemId from Nodes where nodeId = ?' , nodeId ) #NEWLINE# self . assertEqual ( cu . fetchall ( ) [ 0 ] [ 0 ] , srcId )