<commit_before>"""
Tests for jpmesh.angle.
"""

import unittest

from jpmesh.angle import Angle


class TestAngle(unittest.TestCase):
    """
    Tests for jpmesh.angle.Angle.
    """

    def test_properties(self):
        """
        Test for properties.
        """
        millisecond = 3600000
        angle = Angle.from_millisecond(millisecond)
        self.assertEqual(angle.degree, float(millisecond) / 60 / 60 / 1000)
        self.assertEqual(angle.minute, float(millisecond) / 60 / 1000)
        self.assertEqual(angle.second, float(millisecond) / 1000)
        self.assertEqual(angle.millisecond, float(millisecond))

    def test_operators(self):
        """
        Test for operators.
        """
        angle1 = Angle.from_degree(1.0)
        angle2 = Angle.from_degree(2.0)
        self.assertEqual(
            (angle1 + angle2).degree, angle1.degree + angle2.degree)
        self.assertEqual(
            (angle1 - angle2).degree, angle1.degree - angle2.degree)
        self.assertEqual((angle1 * 2).degree, angle1.degree * 2)
        self.assertEqual((angle1 / 2.0).degree, angle1.degree / 2.0)
        self.assertEqual((angle2 // 2).degree, angle2.degree // 2)
        self.assertEqual((+angle1).degree, +angle1.degree)
        self.assertEqual((-angle1).degree, -angle1.degree)
        self.assertEqual(abs(angle1).degree, abs(angle1.degree))<commit_msg>Add a test for operator / with an integer.<commit_after>"""
Tests for jpmesh.angle.
"""

import unittest

from jpmesh.angle import Angle


class TestAngle(unittest.TestCase):
    """
    Tests for jpmesh.angle.Angle.
    """

    def test_properties(self):
        """
        Test for properties.
        """
        millisecond = 3600000
        angle = Angle.from_millisecond(millisecond)
        self.assertEqual(angle.degree, float(millisecond) / 60 / 60 / 1000)
        self.assertEqual(angle.minute, float(millisecond) / 60 / 1000)
        self.assertEqual(angle.second, float(millisecond) / 1000)
        self.assertEqual(angle.millisecond, float(millisecond))

    def test_operators(self):
        """
        Test for operators.
        """
        angle1 = Angle.from_degree(1.0)
        angle2 = Angle.from_degree(2.0)
        self.assertEqual(
            (angle1 + angle2).degree, angle1.degree + angle2.degree)
        self.assertEqual(
            (angle1 - angle2).degree, angle1.degree - angle2.degree)
        self.assertEqual((angle1 * 2).degree, angle1.degree * 2)
        self.assertEqual((angle1 / 2).degree, angle1.degree / 2)
        self.assertEqual((angle1 / 2.0).degree, angle1.degree / 2.0)
        self.assertEqual((angle2 // 2).degree, angle2.degree // 2)
        self.assertEqual((+angle1).degree, +angle1.degree)
        self.assertEqual((-angle1).degree, -angle1.degree)
        self.assertEqual(abs(angle1).degree, abs(angle1.degree))
{'fraction_non_alphanumeric': 0.13070976809557272, 'fraction_numerical': 0.04286718200983837, 'mean_word_length': 2.488970588235294, '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': '6580280', 'n_tokens_mistral': 921, 'n_tokens_neox': 852, 'n_words': 160}