<filename>tests/test_time_days.py<gh_stars>0
# <auto-generated>
# This code was generated by the UnitCodeGenerator tool
#
# Changes to this file will be lost if the code is regenerated
# </auto-generated>

import unittest
import units.time.days

class TestDaysMethods(unittest.TestCase):

	def test_convert_known_days_to_seconds(self):
		self.assertAlmostEqual(120960.0, units.time.days.to_seconds(1.4), places=1)
		self.assertAlmostEqual(5184.0, units.time.days.to_seconds(0.06), places=1)
		self.assertAlmostEqual(17280.0, units.time.days.to_seconds(0.2), places=1)

	def test_convert_known_days_to_minutes(self):
		self.assertAlmostEqual(48960.0, units.time.days.to_minutes(34.0), places=1)
		self.assertAlmostEqual(86.4, units.time.days.to_minutes(0.06), places=1)
		self.assertAlmostEqual(11664.0, units.time.days.to_minutes(8.1), places=1)

	def test_convert_known_days_to_hours(self):
		self.assertAlmostEqual(194.4, units.time.days.to_hours(8.1), places=1)
		self.assertAlmostEqual(4.8, units.time.days.to_hours(0.2), places=1)
		self.assertAlmostEqual(2904.0, units.time.days.to_hours(121.0), places=1)

	def test_convert_known_days_to_weeks(self):
		self.assertAlmostEqual(17.2857, units.time.days.to_weeks(121.0), places=1)
		self.assertAlmostEqual(1.02857, units.time.days.to_weeks(7.2), places=1)
		self.assertAlmostEqual(0.128571, units.time.days.to_weeks(0.9), places=1)

	def test_convert_known_days_to_months(self):
		self.assertAlmostEqual(0.029589, units.time.days.to_months(0.9), places=1)
		self.assertAlmostEqual(3.55068, units.time.days.to_months(108.0), places=1)
		self.assertAlmostEqual(1.80822, units.time.days.to_months(55.0), places=1)

	def test_convert_known_days_to_years(self):
		self.assertAlmostEqual(0.150685, units.time.days.to_years(55.0), places=1)
		self.assertAlmostEqual(0.336986, units.time.days.to_years(123.0), places=1)
		self.assertAlmostEqual(2.46575, units.time.days.to_years(900.0), places=1)

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

<filename>tests/test_time_days.py<gh_stars>0
# <auto-generated>
# This code was generated by the UnitCodeGenerator tool
#
# Changes to this file will be lost if the code is regenerated
# </auto-generated>

import unittest
import units.time.days

class TestDaysMethods(unittest.TestCase):

	def test_convert_known_days_to_seconds(self):
		self.assertAlmostEqual(120960.0, units.time.days.to_seconds(1.4), places=1)
		self.assertAlmostEqual(5184.0, units.time.days.to_seconds(0.06), places=1)
		self.assertAlmostEqual(17280.0, units.time.days.to_seconds(0.2), places=1)

	def test_convert_known_days_to_minutes(self):
		self.assertAlmostEqual(48960.0, units.time.days.to_minutes(34.0), places=1)
		self.assertAlmostEqual(86.4, units.time.days.to_minutes(0.06), places=1)
		self.assertAlmostEqual(11664.0, units.time.days.to_minutes(8.1), places=1)

	def test_convert_known_days_to_hours(self):
		self.assertAlmostEqual(194.4, units.time.days.to_hours(8.1), places=1)
		self.assertAlmostEqual(4.8, units.time.days.to_hours(0.2), places=1)
		self.assertAlmostEqual(2904.0, units.time.days.to_hours(121.0), places=1)

	def test_convert_known_days_to_weeks(self):
		self.assertAlmostEqual(17.2857, units.time.days.to_weeks(121.0), places=1)
		self.assertAlmostEqual(1.02857, units.time.days.to_weeks(7.2), places=1)
		self.assertAlmostEqual(0.128571, units.time.days.to_weeks(0.9), places=1)

	def test_convert_known_days_to_months(self):
		self.assertAlmostEqual(0.029589, units.time.days.to_months(0.9), places=1)
		self.assertAlmostEqual(3.55068, units.time.days.to_months(108.0), places=1)
		self.assertAlmostEqual(1.80822, units.time.days.to_months(55.0), places=1)

	def test_convert_known_days_to_years(self):
		self.assertAlmostEqual(0.150685, units.time.days.to_years(55.0), places=1)
		self.assertAlmostEqual(0.336986, units.time.days.to_years(123.0), places=1)
		self.assertAlmostEqual(2.46575, units.time.days.to_years(900.0), places=1)

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

# <auto-generated> # This code was generated by the UnitCodeGenerator tool # # Changes to this file will be lost if the code is regenerated # </auto-generated>