<commit_before>from .. utils import TranspileTestCase, BuiltinFunctionTestCase


class AbsTests(TranspileTestCase):
    def test_abs_not_implemented(self):
        self.assertCodeExecution("""
            class NotAbsLike:
                pass
            x = NotAbsLike()
            try:
                print(abs(x))
            except TypeError as err:
                print(err)
            """)


class BuiltinAbsFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
    functions = ["abs"]

    not_implemented = [
    ]
<commit_msg>add test case for incorrect abs call<commit_after>from .. utils import TranspileTestCase, BuiltinFunctionTestCase

from unittest import expectedFailure


class AbsTests(TranspileTestCase):
    def test_abs_not_implemented(self):
        self.assertCodeExecution("""
            class NotAbsLike:
                pass
            x = NotAbsLike()
            try:
                print(abs(x))
            except TypeError as err:
                print(err)
            """)

    @expectedFailure
    def test_incorrect_abs_call(self):
        self.assertCodeExecution("""
            x = 1
            print(x.abs())
            """)


class BuiltinAbsFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
    functions = ["abs"]

    not_implemented = [
    ]

{'fraction_non_alphanumeric': 0.08314263920671243, 'fraction_numerical': 0.0007627765064836003, 'mean_word_length': 2.07981220657277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5294659', 'n_tokens_mistral': 357, 'n_tokens_neox': 338, 'n_words': 73}