From bc547cc214608c6fa533f0b2d9e5b0bf9d7d8da8 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Tue, 14 Jul 2020 12:00:30 +0200 Subject: [PATCH] pow method added --- tests/test_SpectralQty.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_SpectralQty.py b/tests/test_SpectralQty.py index 064addf..0124f0a 100644 --- a/tests/test_SpectralQty.py +++ b/tests/test_SpectralQty.py @@ -66,6 +66,12 @@ class TestSpectralQty(TestCase): self.assertEqual(self.sqty / (lambda wl: 0.7 * u.dimensionless_unscaled), SpectralQty(self.wl, self.qty / 0.7)) + def test___pow__(self): + # Integer + self.assertEqual(self.sqty ** 2, SpectralQty(self.wl, self.qty ** 2)) + # Float + self.assertEqual(self.sqty ** 0.5, SpectralQty(self.wl, self.qty ** 0.5)) + def test___sub__(self): # Quantity self.assertEqual(self.sqty - 0.1 * u.W / (u.m ** 2 * u.nm),