<s> from conary_test import rephelp <EOL> from conary . versions import VersionFromString as VFS <EOL> from conary . build import nextversion <EOL> from conary . deps import deps <EOL> class NextVersionTest ( rephelp . RepositoryHelper ) : <EOL> def testNextVersions ( self ) : <EOL> trv = self . addComponent ( '<STR_LIT>' , '<STR_LIT:1>' ) <EOL> self . addComponent ( '<STR_LIT>' , '<STR_LIT:1>' ) <EOL> self . addCollection ( '<STR_LIT:foo>' , '<STR_LIT:1>' , [ '<STR_LIT>' ] ) <EOL> localVersion = VFS ( '<STR_LIT>' ) <EOL> sourceList = [ ( trv . getVersion ( ) , [ '<STR_LIT:foo>' ] , deps . Flavor ( ) ) , <EOL> ( localVersion , [ '<STR_LIT:bar>' ] , deps . Flavor ( ) ) ] <EOL> repos = self . openRepository ( ) <EOL> nextVersions = nextversion . nextVersions ( repos , self . openDatabase ( ) , <EOL> sourceList ) <EOL> assert ( nextVersions == [ VFS ( '<STR_LIT>' ) , <EOL> VFS ( '<STR_LIT>' ) ] ) <EOL> def testNextVersionMultipleBranchesWithDepth ( self ) : <EOL> self . addCollection ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> repos = self . openRepository ( ) <EOL> sourceList = [ ( VFS ( '<STR_LIT>' ) , [ '<STR_LIT:foo>' ] , deps . Flavor ( ) ) ] <EOL> nextVersions = nextversion . nextVersions ( repos , self . openDatabase ( ) , <EOL> sourceList ) <EOL> assert ( nextVersions == [ VFS ( '<STR_LIT>' ) ] ) <EOL> def testNextVersionMultipleBranchesWithDepth2 ( self ) : <EOL> self . addCollection ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> repos = self . openRepository ( ) <EOL> sourceList = [ ( VFS ( '<STR_LIT>' ) , [ '<STR_LIT:foo>' ] , deps . Flavor ( ) ) ] <EOL> nextVersions = nextversion . nextVersions ( repos , self . openDatabase ( ) , <EOL> sourceList ) <EOL> assert ( nextVersions == [ VFS ( '<STR_LIT>' ) ] ) <EOL> def testNextVersionLatestDevelOnOtherBranch ( self ) : <EOL> self . addCollection ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) <EOL> self . addCollection ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> sourceList = [ ( VFS ( '<STR_LIT>' ) , [ '<STR_LIT:foo>' ] , deps . Flavor ( ) ) ] <EOL> nextVersions = nextversion . nextVersions ( self . openRepository ( ) , <EOL> self . openDatabase ( ) , sourceList ) <EOL> assert ( nextVersions == [ VFS ( '<STR_LIT>' ) ] ) <EOL> def testNextVersionLatestDevelOnThisBranch ( self ) : <EOL> self . addCollection ( '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> self . addCollection ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) <EOL> sourceList = [ ( VFS ( '<STR_LIT>' ) , [ '<STR_LIT:foo>' ] , deps . Flavor ( ) ) ] <EOL> nextVersions = nextversion . nextVersions ( self . openRepository ( ) , <EOL> self . openDatabase ( ) , sourceList ) <EOL> assert ( nextVersions == [ VFS ( '<STR_LIT>' ) ] ) </s>
