[Python-checkins] python/nondist/sandbox/sets test_set.py,1.4,1.5

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 15 Aug 2002 13:47:33 -0700


Update of /cvsroot/python/python/nondist/sandbox/sets
In directory usw-pr-cvs1:/tmp/cvs-serv4209

Modified Files:
	test_set.py 
Log Message:
Get rid of TestFreeze -- we don't need freezing semantics any more.


Index: test_set.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/sets/test_set.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_set.py	15 Aug 2002 20:43:07 -0000	1.4
--- test_set.py	15 Aug 2002 20:47:31 -0000	1.5
***************
*** 6,10 ****
  empty_set = Set()
  
! #===============================================================================
  
  class TestBasicOps(unittest.TestCase):
--- 6,10 ----
  empty_set = Set()
  
! #==============================================================================
  
  class TestBasicOps(unittest.TestCase):
***************
*** 74,78 ****
              assert v in self.values, "Missing item in iteration for " + self.case
  
! #-------------------------------------------------------------------------------
  
  class TestBasicOpsEmpty(TestBasicOps):
--- 74,78 ----
              assert v in self.values, "Missing item in iteration for " + self.case
  
! #------------------------------------------------------------------------------
  
  class TestBasicOpsEmpty(TestBasicOps):
***************
*** 85,89 ****
          self.repr   = "Set([])"
  
! #-------------------------------------------------------------------------------
  
  class TestBasicOpsSingleton(TestBasicOps):
--- 85,89 ----
          self.repr   = "Set([])"
  
! #------------------------------------------------------------------------------
  
  class TestBasicOpsSingleton(TestBasicOps):
***************
*** 102,106 ****
          assert 2 not in self.set, "Non-valueship for unit set"
  
! #-------------------------------------------------------------------------------
  
  class TestBasicOpsTuple(TestBasicOps):
--- 102,106 ----
          assert 2 not in self.set, "Non-valueship for unit set"
  
! #------------------------------------------------------------------------------
  
  class TestBasicOpsTuple(TestBasicOps):
***************
*** 119,123 ****
          assert 9 not in self.set, "Non-valueship for tuple set"
  
! #-------------------------------------------------------------------------------
  
  class TestBasicOpsTriple(TestBasicOps):
--- 119,123 ----
          assert 9 not in self.set, "Non-valueship for tuple set"
  
! #------------------------------------------------------------------------------
  
  class TestBasicOpsTriple(TestBasicOps):
***************
*** 130,134 ****
          self.repr   = None
  
! #===============================================================================
  
  class TestBinaryOps(unittest.TestCase):
--- 130,134 ----
          self.repr   = None
  
! #==============================================================================
  
  class TestBinaryOps(unittest.TestCase):
***************
*** 184,188 ****
          assert result == Set([2, 4, 6, 8]), "Non-overlapping symmetric difference"
  
! #===============================================================================
  
  class TestUpdateOps(unittest.TestCase):
--- 184,188 ----
          assert result == Set([2, 4, 6, 8]), "Non-overlapping symmetric difference"
  
! #==============================================================================
  
  class TestUpdateOps(unittest.TestCase):
***************
*** 238,242 ****
          assert self.set == Set([2, 4, 6, 8]), "Non-overlapping symmetric difference"
  
! #===============================================================================
  
  class TestMutate(unittest.TestCase):
--- 238,242 ----
          assert self.set == Set([2, 4, 6, 8]), "Non-overlapping symmetric difference"
  
! #==============================================================================
  
  class TestMutate(unittest.TestCase):
***************
*** 312,374 ****
          assert self.set == Set(self.values + ["z"]), "Updating with non-overlapping unit tuple"
  
! #===============================================================================
! 
! class TestFreeze(unittest.TestCase):
!     def setUp(self):
!         self.values = [0, 1]
!         self.set = Set(self.values)
!         self.set = ImmutableSet(self.set)
!         hash(self.set)
! 
!     def test_clear_after_freeze(self):
!         try:
!             self.set.clear()
!             assert 0, "Empty disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_union_after_freeze(self):
!         try:
!             self.set |= Set([2])
!             assert 0, "Union update disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_intersection_after_freeze(self):
!         try:
!             self.set &= Set([2])
!             assert 0, "Intersection update disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_sym_difference_after_freeze(self):
!         try:
!             self.set ^= Set([2])
!             assert 0, "Symmetric difference update disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_difference_after_freeze(self):
!         try:
!             self.set -= Set([2])
!             assert 0, "Difference update disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_add_after_freeze(self):
!         try:
!             self.set.add(4)
!             assert 0, "Add disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
!     def test_update_after_freeze(self):
!         try:
!             self.set.update([4, 5])
!             assert 0, "Update disregards freezing"
!         except (TypeError, AttributeError):
!             pass
! 
! #===============================================================================
  
  class TestSubsets(unittest.TestCase):
--- 312,316 ----
          assert self.set == Set(self.values + ["z"]), "Updating with non-overlapping unit tuple"
  
! #==============================================================================
  
  class TestSubsets(unittest.TestCase):
***************
*** 381,385 ****
              assert not result, "non-subset: " + self.name
  
! #-------------------------------------------------------------------------------
  
  class TestSubsetEqualEmpty(TestSubsets):
--- 323,327 ----
              assert not result, "non-subset: " + self.name
  
! #------------------------------------------------------------------------------
  
  class TestSubsetEqualEmpty(TestSubsets):
***************
*** 390,394 ****
          self.cases = "<>"
  
! #-------------------------------------------------------------------------------
  
  class TestSubsetEqualNonEmpty(TestSubsets):
--- 332,336 ----
          self.cases = "<>"
  
! #------------------------------------------------------------------------------
  
  class TestSubsetEqualNonEmpty(TestSubsets):
***************
*** 399,403 ****
          self.cases = "<>"
  
! #-------------------------------------------------------------------------------
  
  class TestSubsetEmptyNonEmpty(TestSubsets):
--- 341,345 ----
          self.cases = "<>"
  
! #------------------------------------------------------------------------------
  
  class TestSubsetEmptyNonEmpty(TestSubsets):
***************
*** 408,412 ****
          self.cases = "<"
  
! #-------------------------------------------------------------------------------
  
  class TestSubsetPartial(TestSubsets):
--- 350,354 ----
          self.cases = "<"
  
! #------------------------------------------------------------------------------
  
  class TestSubsetPartial(TestSubsets):
***************
*** 417,421 ****
          self.cases = "<"
  
! #-------------------------------------------------------------------------------
  
  class TestSubsetNonOverlap(TestSubsets):
--- 359,363 ----
          self.cases = "<"
  
! #------------------------------------------------------------------------------
  
  class TestSubsetNonOverlap(TestSubsets):
***************
*** 426,430 ****
          self.cases = ""
  
! #===============================================================================
  
  class TestOnlySetsInBinaryOps(unittest.TestCase):
--- 368,372 ----
          self.cases = ""
  
! #==============================================================================
  
  class TestOnlySetsInBinaryOps(unittest.TestCase):
***************
*** 518,522 ****
              pass
  
! #-------------------------------------------------------------------------------
  
  class TestOnlySetsNumeric(TestOnlySetsInBinaryOps):
--- 460,464 ----
              pass
  
! #------------------------------------------------------------------------------
  
  class TestOnlySetsNumeric(TestOnlySetsInBinaryOps):
***************
*** 525,529 ****
          self.other = 19
  
! #-------------------------------------------------------------------------------
  
  class TestOnlySetsDict(TestOnlySetsInBinaryOps):
--- 467,471 ----
          self.other = 19
  
! #------------------------------------------------------------------------------
  
  class TestOnlySetsDict(TestOnlySetsInBinaryOps):
***************
*** 532,536 ****
          self.other = {1:2, 3:4}
  
! #-------------------------------------------------------------------------------
  
  class TestOnlySetsOperator(TestOnlySetsInBinaryOps):
--- 474,478 ----
          self.other = {1:2, 3:4}
  
! #------------------------------------------------------------------------------
  
  class TestOnlySetsOperator(TestOnlySetsInBinaryOps):
***************
*** 539,543 ****
          self.other = operator.add
  
! #===============================================================================
  
  class TestCopying(unittest.TestCase):
--- 481,485 ----
          self.other = operator.add
  
! #==============================================================================
  
  class TestCopying(unittest.TestCase):
***************
*** 560,564 ****
              assert dup_list[i] == set_list[i], "Unequal items after deep copy"
  
! #-------------------------------------------------------------------------------
  
  class TestCopyingEmpty(TestCopying):
--- 502,506 ----
              assert dup_list[i] == set_list[i], "Unequal items after deep copy"
  
! #------------------------------------------------------------------------------
  
  class TestCopyingEmpty(TestCopying):
***************
*** 566,570 ****
          self.set = Set()
  
! #-------------------------------------------------------------------------------
  
  class TestCopyingSingleton(TestCopying):
--- 508,512 ----
          self.set = Set()
  
! #------------------------------------------------------------------------------
  
  class TestCopyingSingleton(TestCopying):
***************
*** 572,576 ****
          self.set = Set(["hello"])
  
! #-------------------------------------------------------------------------------
  
  class TestCopyingTriple(TestCopying):
--- 514,518 ----
          self.set = Set(["hello"])
  
! #------------------------------------------------------------------------------
  
  class TestCopyingTriple(TestCopying):
***************
*** 578,582 ****
          self.set = Set(["zero", 0, None])
  
! #-------------------------------------------------------------------------------
  
  class TestCopyingTuple(TestCopying):
--- 520,524 ----
          self.set = Set(["zero", 0, None])
  
! #------------------------------------------------------------------------------
  
  class TestCopyingTuple(TestCopying):
***************
*** 584,588 ****
          self.set = Set([(1, 2)])
  
! #-------------------------------------------------------------------------------
  
  class TestCopyingNested(TestCopying):
--- 526,530 ----
          self.set = Set([(1, 2)])
  
! #------------------------------------------------------------------------------
  
  class TestCopyingNested(TestCopying):
***************
*** 590,594 ****
          self.set = Set([((1, 2), (3, 4))])
  
! #===============================================================================
  
  def makeAllTests():
--- 532,536 ----
          self.set = Set([((1, 2), (3, 4))])
  
! #==============================================================================
  
  def makeAllTests():
***************
*** 601,605 ****
      suite.addTest(unittest.makeSuite(TestUpdateOps))
      suite.addTest(unittest.makeSuite(TestMutate))
-     suite.addTest(unittest.makeSuite(TestFreeze))
      suite.addTest(unittest.makeSuite(TestSubsetEqualEmpty))
      suite.addTest(unittest.makeSuite(TestSubsetEqualNonEmpty))
--- 543,546 ----
***************
*** 617,621 ****
      return suite
  
! #-------------------------------------------------------------------------------
  
  if __name__ == "__main__":
--- 558,562 ----
      return suite
  
! #------------------------------------------------------------------------------
  
  if __name__ == "__main__":