def test_sequential_conflicts(self): self.assertEqual([ " 0", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", " 10", ], params.build_conflicting_ids( params.IndexIdConflict.SequentialConflicts, 11, 0)) self.assertEqual([ " 5", " 6", " 7", " 8", " 9", " 10", " 11", " 12", " 13", " 14", " 15", ], params.build_conflicting_ids( params.IndexIdConflict.SequentialConflicts, 11, 5))
def test_sequential_conflicts(self): self.assertEqual( [ " 0", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", " 10", ], params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 11, 0) ) self.assertEqual( [ " 5", " 6", " 7", " 8", " 9", " 10", " 11", " 12", " 13", " 14", " 15", ], params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 11, 5) )
def test_build_conflicting_ids(self): self.assertIsNone( params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 3, 0)) self.assertEqual([" 0", " 1", " 2"], params.build_conflicting_ids( params.IndexIdConflict.SequentialConflicts, 3, 0)) # we cannot tell anything specific about the contents... self.assertEqual( 3, len( params.build_conflicting_ids( params.IndexIdConflict.RandomConflicts, 3, 0)))
def test_random_conflicts(self): self.assertEqual([" 3", " 3", " 3"], params.build_conflicting_ids( params.IndexIdConflict.RandomConflicts, 3, 0, rand=lambda x, y: y)) self.assertEqual([" 8", " 8", " 8"], params.build_conflicting_ids( params.IndexIdConflict.RandomConflicts, 3, 5, rand=lambda x, y: y))
def test_random_conflicts(self): self.assertEqual( [ " 3", " 3", " 3" ], params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 0, rand=lambda x, y: y) ) self.assertEqual( [ " 8", " 8", " 8" ], params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 5, rand=lambda x, y: y) )
def test_no_id_conflicts(self): self.assertIsNone(params.build_conflicting_ids(None, 100, 0)) self.assertIsNone( params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 100, 0))
def test_no_id_conflicts(self): self.assertIsNone(params.build_conflicting_ids(None, 100, 0)) self.assertIsNone(params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 100, 0))
def test_build_conflicting_ids(self): self.assertIsNone(params.build_conflicting_ids(params.IndexIdConflict.NoConflicts, 3, 0)) self.assertEqual([" 0", " 1", " 2"], params.build_conflicting_ids(params.IndexIdConflict.SequentialConflicts, 3, 0)) # we cannot tell anything specific about the contents... self.assertEqual(3, len(params.build_conflicting_ids(params.IndexIdConflict.RandomConflicts, 3, 0)))