Skip to content

Commit

Permalink
Adds api tests for operations with non-dimensionals
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxcode123 committed Sep 20, 2024
1 parent 340b756 commit f1589e4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/property_utils/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,19 @@ def test_sub(self):
@args({"p1": p(11, JOULE / KELVIN), "p2": p(10, JOULE / KELVIN), "op": ge})
def test_greater_or_equal(self):
self.assertResultTrue()

@args({"p1": p(1) ** 2, "p2": p(1), "op": add})
def test_non_dimensionals_addition(self):
self.assert_result("2.0 ")

@args({"p1": p(1) / p(1), "p2": p(1), "op": add})
def test_non_dimensionals_addition_2(self):
self.assert_result("2.0 ")

@args({"p1": p(1) / (p(1) ** 2), "p2": p(1), "op": add})
def test_non_dimensionals_addition_3(self):
self.assert_result("2.0 ")

@args({"p1": (p(1) ** 2) ** 3, "p2": p(1), "op": add})
def test_non_dimensionals_addition_4(self):
self.assert_result("2.0 ")

0 comments on commit f1589e4

Please sign in to comment.