Пример #1
0
    def test_SubstrWWithZeroLength(self):
        subString = substr("abcdef", 3, 0)

        self.assertFalse(subString)
Пример #2
0
    def test_SubstrWithNegativeLength(self):
        subString = substr("abcdef", 2, -1)

        self.assertEqual(subString, 'cde')
Пример #3
0
    def test_SubstrWithANumberTooNegative(self):
        subString = substr("abcdef", 4, -4)

        self.assertFalse(subString)
Пример #4
0
    def test_SubstrWithNULLInput(self):
        subString = substr(None, -1)

        self.assertFalse(subString)
Пример #5
0
    def test_SubstrWithPositiveLength(self):
        subString = substr("abcdef", 3, 1)

        self.assertEqual(subString, 'd')
Пример #6
0
    def test_SubstrWithNegativeStartIndex(self):
        subString = substr("hello", -1)

        self.assertEqual(subString, "o")
Пример #7
0
    def test_SubstrLenthLessThanNegativeStartIndex(self):
        subString = substr("one", -4)

        self.assertFalse(subString)
Пример #8
0
	def test_SubstrWWithZeroLength(self):
		subString = substr("abcdef", 3, 0)

		self.assertFalse(subString)
Пример #9
0
    def test_SubstrWithPositiveStartIndex(self):
        subString = substr("hello", 2)

        self.assertEqual(subString, "llo")
Пример #10
0
	def test_SubstrWithNegativeLength(self):
		subString = substr("abcdef", 2, -1)

		self.assertEqual(subString, 'cde')
Пример #11
0
	def test_SubstrWithANumberTooNegative(self):
		subString = substr("abcdef", 4, -4)

		self.assertFalse(subString)
Пример #12
0
	def test_SubstrWithPositiveLength(self):
		subString = substr("abcdef", 3, 1)

		self.assertEqual(subString, 'd')
Пример #13
0
	def test_SubstrWithNULLInput(self):
		subString = substr(None, -1)

		self.assertFalse(subString)
Пример #14
0
	def test_SubstrLenthLessThanNegativeStartIndex(self):
		subString = substr("one", -4)

		self.assertFalse(subString)
Пример #15
0
	def test_SubstrWithNegativeStartIndex(self):
		subString = substr("hello", -1)

		self.assertEqual(subString, "o")
Пример #16
0
	def test_SubstrWithPositiveStartIndex(self):
		subString = substr("hello", 2)

		self.assertEqual(subString, "llo")