Beispiel #1
0
 def test_sd_fromkeys(self):
     x = sorteddict.fromkeys([1, 2, 3, 4, 5, 6])
     assert len(x) == 6
     assert x[6] is None
     x = sorteddict.fromkeys((1, 2, 3, 4, 5), 'abc')
     assert len(x) == 5
     assert x[5] == 'abc'
Beispiel #2
0
 def test_sd_fromkeys(self):
     x = sorteddict.fromkeys([1,2,3,4,5,6])
     assert len(x) == 6
     assert x[6] is None
     x = sorteddict.fromkeys((1,2,3,4,5), 'abc')
     assert len(x) == 5
     assert x[5] == 'abc'
Beispiel #3
0
 def test_sd_setkeys(self):
     x = sorteddict.fromkeys((1, 2, 3, 4, 5), 'abc')
     if not self.nopytest:
         py.test.raises(TypeError, "x.setkeys((5, 3, 1, 2, 4,))")
Beispiel #4
0
 def test_sd_setkeys(self):
     x = sorteddict.fromkeys((1,2,3,4,5), 'abc')
     if not self.nopytest:
         py.test.raises(TypeError, "x.setkeys((5, 3, 1, 2, 4,))")