Files
python/exercises/practice/square-root/square_root_test.py
BethanyG e7a6b0dc7d [JinJa2] Corrected the macro used for comments on the test file. (#3373)
* Corrected the macro for comments on the test file.
* Added current_date (utcnow()) variable available for template macros.
* Removed unnecessary datetime import from macros file.
* Regenerated all practice exercise test files to add timestamp.
* Changed `datetime.now(tz=timezone.utc)` to `datetime.now(tz=timezone.utc).date()`
* Second regeneration to remove `timestamp` and just keep `date` for test files.
[no important files changed]
2023-07-14 15:52:15 -07:00

30 lines
767 B
Python

import unittest
from square_root import (
square_root,
)
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/square-root/canonical-data.json
# File last updated on 2023-07-14
class SquareRootTest(unittest.TestCase):
def test_root_of_1(self):
self.assertEqual(square_root(1), 1)
def test_root_of_4(self):
self.assertEqual(square_root(4), 2)
def test_root_of_25(self):
self.assertEqual(square_root(25), 5)
def test_root_of_81(self):
self.assertEqual(square_root(81), 9)
def test_root_of_196(self):
self.assertEqual(square_root(196), 14)
def test_root_of_65025(self):
self.assertEqual(square_root(65025), 255)