@dj2638/

MathGear - Python 27

Python 2.7

No description

fork
loading
Files
  • main.py
  • functions.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest
from functions import LawOfCosines
import math

# print(dir(unittest.TestCase))


class LawOfCosinesTestCase(unittest.TestCase):
	def setUp(self):
		self.triangle = {"a": 50, "b": 60, "c": 20,
						 "A": 51.3, "B": 110.5, "C": 18.2}

	def test_solve_sas(self):
		result = LawOfCosines.sas(self.triangle["a"], self.triangle["C"], self.triangle["b"])
		self.assertEqual(result, self.triangle["c"])

	def test_solve_sss(self):
		result = LawOfCosines.sss(self.triangle["a"], self.triangle["b"], self.triangle["c"])
		self.assertEqual(result, self.triangle["C"])

if __name__ == "__main__":
	unittest.main()