Exemplo n.º 1
0
 def setUp(self):
     self.fbe = FunctionBodyExtractor()
Exemplo n.º 2
0
    def test_when_input_is_string_and_offset_is_greater_than_string_length_then_return_None(
            self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 10)
        self.assertEqual(None, response)
Exemplo n.º 3
0
    def test_when_input_is_string_and_offset_is_positive_then_get_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 2)
        self.assertEqual('C', response)
Exemplo n.º 4
0
    def test_when_input_is_string_and_offset_is_zero_then_get_first_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('abcdef', 0)
        self.assertEqual('a', response)
Exemplo n.º 5
0
    def test_when_input_is_None_then_return_None(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char(None, -1)
        self.assertEqual(None, response)
Exemplo n.º 6
0
    def test_when_last_char_is_space_then_return_the_empty_space_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('content123 ', -1)
        self.assertEqual(' ', response)